From dcbdddde3c030f419a2064f1c952b26c27fe9a2a Mon Sep 17 00:00:00 2001 From: root Date: Sun, 10 Aug 2014 08:30:47 +0200 Subject: [PATCH 1/4] fix sidebar height issue, request sent button issue --- web/app/assets/javascripts/hoverMusician.js | 10 +++++++--- web/app/assets/stylesheets/client/sidebar.css.scss | 8 +++++++- web/app/views/clients/_hoverMusician.html.erb | 4 +++- web/app/views/clients/_sidebar.html.erb | 2 ++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/web/app/assets/javascripts/hoverMusician.js b/web/app/assets/javascripts/hoverMusician.js index 985da502b..70f688d35 100644 --- a/web/app/assets/javascripts/hoverMusician.js +++ b/web/app/assets/javascripts/hoverMusician.js @@ -95,7 +95,8 @@ session_display: sessionDisplayStyle, join_display: joinDisplayStyle, sessionId: sessionId, - friendAction: response.is_friend ? "removeMusicianFriend" : (response.pending_friend_request ? "" : "sendMusicianFriendRequest"), + //friendAction: response.is_friend ? "removeMusicianFriend" : (response.pending_friend_request ? "" : "sendMusicianFriendRequest"), + friendAction: response.is_friend ? "" : (response.pending_friend_request ? "" : "sendMusicianFriendRequest"), followAction: response.is_following ? "removeMusicianFollowing" : "addMusicianFollowing", biography: response.biography, followings: response.followings && response.followings.length > 0 ? followingHtml : "N/A", @@ -133,13 +134,16 @@ } else { if (user.is_friend) { - $(btnFriendSelector, hoverSelector).html('DISCONNECT'); + $(btnFriendSelector, hoverSelector).html('CONNECTED'); + $(btnFriendSelector, hoverSelector).addClass('disabled'); } if (user.is_following) { $(btnFollowSelector, hoverSelector).html('UNFOLLOW'); } if (user.pending_friend_request) { - $(btnFriendSelector, hoverSelector).hide(); + //$(btnFriendSelector, hoverSelector).hide(); + $(btnFriendSelector, hoverSelector).html('REQUEST SENT'); + $(btnFriendSelector, hoverSelector).addClass('disabled'); } } diff --git a/web/app/assets/stylesheets/client/sidebar.css.scss b/web/app/assets/stylesheets/client/sidebar.css.scss index f934b0cf3..09c4a4585 100644 --- a/web/app/assets/stylesheets/client/sidebar.css.scss +++ b/web/app/assets/stylesheets/client/sidebar.css.scss @@ -181,7 +181,11 @@ display: block; overflow: auto; margin: 0px 15px; - height: 210px; + /*height: 210px;*/ + height: 73%; + } + .chart-text-section { + } .btn-send-chat-message { @@ -232,6 +236,8 @@ position: absolute; bottom: 10px; padding: 0px 15px; + height: 20%; + min-height: 69px; } em { diff --git a/web/app/views/clients/_hoverMusician.html.erb b/web/app/views/clients/_hoverMusician.html.erb index 253e7dceb..f44bd0cbd 100644 --- a/web/app/views/clients/_hoverMusician.html.erb +++ b/web/app/views/clients/_hoverMusician.html.erb @@ -171,7 +171,9 @@ function sendMusicianFriendRequest(userId) { rest.sendFriendRequest(JK.app, userId); - $("#btnFriend", "#musician-hover").hide(); + //$("#btnFriend", "#musician-hover").hide(); + $("#btnFriend").html('REQUEST SENT'); + $("#btnFriend").addClass('disabled'); } function removeMusicianFriend(userId) { diff --git a/web/app/views/clients/_sidebar.html.erb b/web/app/views/clients/_sidebar.html.erb index a0b37fe1f..b488db763 100644 --- a/web/app/views/clients/_sidebar.html.erb +++ b/web/app/views/clients/_sidebar.html.erb @@ -104,10 +104,12 @@
Chat is available when in session.
+
+
From b8c09b912efc8e4ffaf4cafecb6b099639147bee Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 10 Aug 2014 09:29:23 -0500 Subject: [PATCH 2/4] * fake commit to poke jenkins --- web/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/web/README.md b/web/README.md index 03b796614..81ad6e3d8 100644 --- a/web/README.md +++ b/web/README.md @@ -11,3 +11,4 @@ $ rake jasmine Open browser to localhost:8888 + From edc805e442d1d75cf3825b809e09772e11bb5f44 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 13 Aug 2014 12:51:40 -0500 Subject: [PATCH 3/4] * VRFS-2040 - pass in retry value to backend --- .../assets/javascripts/networkTestHelper.js | 53 +++++++++++++++++-- web/config/application.rb | 2 + web/config/initializers/gon.rb | 1 + 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/web/app/assets/javascripts/networkTestHelper.js b/web/app/assets/javascripts/networkTestHelper.js index f8acf0107..1f9260790 100644 --- a/web/app/assets/javascripts/networkTestHelper.js +++ b/web/app/assets/javascripts/networkTestHelper.js @@ -16,6 +16,7 @@ var STARTING_NUM_CLIENTS = 4; var PAYLOAD_SIZE = gon.global.ftue_network_test_packet_size; var MINIMUM_ACCEPTABLE_SESSION_SIZE = 2; + var RETRY_THRESHOLD = 2; var gearUtils = context.JK.GearUtils; var rest = context.JK.Rest(); @@ -291,6 +292,45 @@ return testSummary.attempts[testSummary.attempts.length - 1]; } + function isFirstAttempt() { + return testSummary.attempts.length == 0 || testSummary.attempts.length == 1; + } + + // is this a retry attempt? If so, how many times now has it been. + // 0 = this is the 1st attempt + // > 0 indicates the number of retries. + function numRetryAttempts() { + // starting at the end of the attempts array, see how many have the same session count, which is implicitely + // indicative of a retry + var i = 0; + var testSessionSize = null; + var numSameSizeTests = 0; + + for(i = testSummary.attempts.length - 1; i >= 0; i--) { + var attempt = testSummary.attempts[i]; + + if(testSessionSize === null) { + // this is the 1st loop through. just recording the testSessionSize + testSessionSize = attempt.num_clients; + } + else { + if(testSessionSize == attempt.num_clients) { + numSameSizeTests++; + } + else { + break; // different size session found, so we are digging back into non-retry territory. bail out + } + } + } + return numSameSizeTests; + } + + function hasTooManyRetries() { + return numRetryAttempts() >= RETRY_THRESHOLD; + + return false; + } + function primeTimedOut() { logger.warn("backend never completed priming pump phase"); scoring = false; @@ -358,7 +398,7 @@ NETWORK_TEST_TYPES.PktTest400LowLatency, gon.ftue_network_test_duration, numClientsToTest - 1, - PAYLOAD_SIZE); + PAYLOAD_SIZE, gon.global.ftue_network_test_backend_retries); } // you have to score a little to 'prime' the logic to know whether it's on wireless or not @@ -372,7 +412,7 @@ NETWORK_TEST_TYPES.PktTest400LowLatency, 1, // minimum time needed to prime pump 2, - PAYLOAD_SIZE); + PAYLOAD_SIZE, gon.global.ftue_network_test_backend_retries); return primeDeferred; @@ -503,7 +543,11 @@ var attempt = getCurrentAttempt(); function refineTest(up) { - if (up) { + if (up === null) { + logger.debug("retrying test at size: " + numClientsToTest); + setTimeout(attemptTestPass, 500); // wait a second to avoid race conditions with client/server comm + } + else if (up) { if (numClientsToTest == gon.ftue_network_test_max_clients) { attempt.reason = "success"; testFinished(); @@ -564,8 +608,7 @@ logger.debug("network test pass completed. data: ", data); if (data.reason == "unreachable") { - // STUN - logger.debug("network test: unreachable (STUN issue or similar)"); + logger.debug("network test: unreachable (STUN issue or similar)") attempt.reason = data.reason; testFinished(); } diff --git a/web/config/application.rb b/web/config/application.rb index 6ad4d576e..9ad4baa8c 100644 --- a/web/config/application.rb +++ b/web/config/application.rb @@ -243,6 +243,8 @@ if defined?(Bundler) config.ftue_network_test_max_clients = 8 # packet size (bytes) of test config.ftue_network_test_packet_size = 60 + # number of times that the backend retries before giving up + config.ftue_network_test_backend_retries = 10 # the maximum amount of allowable latency config.ftue_maximum_gear_latency = 20 diff --git a/web/config/initializers/gon.rb b/web/config/initializers/gon.rb index bd840b32f..b2ae6da1b 100644 --- a/web/config/initializers/gon.rb +++ b/web/config/initializers/gon.rb @@ -1,3 +1,4 @@ Gon.global.facebook_app_id = Rails.application.config.facebook_app_id Gon.global.ftue_network_test_packet_size = Rails.application.config.ftue_network_test_packet_size +Gon.global.ftue_network_test_backend_retries = Rails.application.config.ftue_network_test_backend_retries Gon.global.env = Rails.env From 90ec0b3f1a9b4178e9b29234484e9c845b55d9d0 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Wed, 13 Aug 2014 15:32:51 -0500 Subject: [PATCH 4/4] * fix admin tests --- admin/spec/support/utilities.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/spec/support/utilities.rb b/admin/spec/support/utilities.rb index 2055c9495..fa3b3c840 100644 --- a/admin/spec/support/utilities.rb +++ b/admin/spec/support/utilities.rb @@ -8,7 +8,7 @@ def sign_in(user) visit new_user_session_path # login page fill_in "Email", with: user.email fill_in "Password", with: user.password - click_button "Sign in" + click_button "Log in" # Sign in when not using Capybara as well. #cookie_jar[:remember_token] = user.remember_token