Merge branch 'develop' into hotfix/cancel_rsvp_flow

This commit is contained in:
Brian Smith 2014-08-14 02:14:08 -04:00
commit 6a1d1daa9b
9 changed files with 72 additions and 11 deletions

View File

@ -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

View File

@ -11,3 +11,4 @@ $ rake jasmine
Open browser to localhost:8888

View File

@ -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 : "<tr><td>N/A</td></tr>",
@ -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');
}
}

View File

@ -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();
}

View File

@ -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 {

View File

@ -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) {

View File

@ -104,10 +104,12 @@
<div class="chat-status">
<span>Chat is available when in session.</span>
</div>
<div class="chat-list-scroller">
<div class="previous-chat-list wrapword">
</div>
</div>
<div class="chat-sender">
<form class="chat-message-form">
<textarea name="chat-message" id="new-chat-message" placeholder="enter message"></textarea>

View File

@ -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

View File

@ -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