From 5a658c2d5f14c7e6c956f0682dbb85d2fdd1f7fb Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sun, 29 Mar 2020 22:34:03 -0500 Subject: [PATCH] remove jamblaster link, cleanup some links, debug latency-tester, turn down test to 4 --- .../user_mailer/welcome_message.html.erb | 20 +++++++++---------- .../jam_ruby/models/invited_user_observer.rb | 1 - ruby/lib/jam_ruby/models/recording.rb | 9 ++++++--- web/app/assets/javascripts/JamServer.js | 18 +++++++++++++++-- web/app/views/corps/help.html.erb | 2 +- web/app/views/users/_user_dropdown.html.erb | 4 ++-- web/config/application.rb | 2 +- web/config/routes.rb | 2 +- 8 files changed, 37 insertions(+), 21 deletions(-) diff --git a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.html.erb b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.html.erb index f970ce6c2..df16777e4 100644 --- a/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.html.erb +++ b/ruby/lib/jam_ruby/app/views/jam_ruby/user_mailer/welcome_message.html.erb @@ -12,6 +12,16 @@ resources you can use to get the most out of JamKazam.

+

Play Live And In Sync With Others from Different Locations
+ JamKazam’s free Mac and Windows desktop apps let musicians play together live and in sync + + with hiqh quality audio from different locations over the Internet. Great for band rehearsals, + + co-writing music, or just hopping into open jams with other musicians for fun. + + Check out this Getting Started YouTube Video for help setting up +

+

Learn & Play Along With Your Favorite Music
JamTracks by JamKazam are the best way to play along with your favorite songs. JamTracks are @@ -27,16 +37,6 @@ desktop app, or in our free iOS app.

-

Play Live And In Sync With Others from Different Locations
- JamKazam’s free Mac and Windows desktop apps let musicians play together live and in sync - - with hiqh quality audio from different locations over the Internet. Great for band rehearsals, - - co-writing music, or just hopping into open jams with other musicians for fun. - - Check out this Getting Started YouTube Video for help setting up -

-

And More...
You can also connect and network with other musicians. If you diff --git a/ruby/lib/jam_ruby/models/invited_user_observer.rb b/ruby/lib/jam_ruby/models/invited_user_observer.rb index 41d360cbb..d5cc902e2 100644 --- a/ruby/lib/jam_ruby/models/invited_user_observer.rb +++ b/ruby/lib/jam_ruby/models/invited_user_observer.rb @@ -4,7 +4,6 @@ module JamRuby observe JamRuby::InvitedUser def after_create(invited_user) - return # due to abuse if invited_user.sender.nil? InvitedUserMailer.welcome_betauser(invited_user).deliver_now diff --git a/ruby/lib/jam_ruby/models/recording.rb b/ruby/lib/jam_ruby/models/recording.rb index 46fac5e82..23e92e063 100644 --- a/ruby/lib/jam_ruby/models/recording.rb +++ b/ruby/lib/jam_ruby/models/recording.rb @@ -193,7 +193,10 @@ module JamRuby def recorded_tracks_for_user(user) unless self.users.exists?(user.id) - raise JamPermissionError, "user was not in this session" + # THIS CHECK SHOULD PROBABLY COME BACK + # HOWEVER, THIS WAS KILLING WEBSOCKET-GATEWAY ON SOME DROPPED SCENARIOS + # PROBABLY WEBSOCKET_GATEWAY SHOULD PASS SECOND ARG THAT RELAXES THE BELOW CHECK + #raise JamPermissionError, "user was not in this session" end recorded_tracks.where(:user_id => user.id) end @@ -370,7 +373,7 @@ module JamRuby # only discard if the user has previously taken no action def discard_if_no_action(user) track = recorded_tracks_for_user(user).first - if track.discard.nil? + if track && track.discard.nil? discard(user ) end end @@ -802,4 +805,4 @@ module JamRuby end end -end +end \ No newline at end of file diff --git a/web/app/assets/javascripts/JamServer.js b/web/app/assets/javascripts/JamServer.js index d57d1ff37..7f83affec 100644 --- a/web/app/assets/javascripts/JamServer.js +++ b/web/app/assets/javascripts/JamServer.js @@ -21,6 +21,7 @@ var channelId = null; var clientType = null; var mode = null; + var isLatencyTesterMode = false; // heartbeat var startHeartbeatTimeout = null; @@ -94,6 +95,10 @@ // handles logic if the websocket connection closes, and if it was in error then also prompt for reconnect function closedCleanup(in_error) { + if(isLatencyTester()) { + logger.info("latency-tester: websocket connection lost") + } + if(server.connected) { $self.triggerHandler(EVENTS.CONNECTION_DOWN); } @@ -174,6 +179,10 @@ } function _heartbeat() { + + if(isLatencyTester()) { + logger.info("latency-tester debug: heartbeat" + app.heartbeatActive) + } if (app.heartbeatActive) { //console.log("heartbeat active?: " + active) var message = context.JK.MessageFactory.heartbeat(notificationLastSeen, notificationLastSeenAt, active); @@ -199,6 +208,10 @@ return mode == "client"; } + function isLatencyTester() { + return isLatencyTesterMode; + } + function clearConnectTimeout() { if (connectTimeout) { clearTimeout(connectTimeout); @@ -638,6 +651,7 @@ if (context.jamClient && context.jamClient.getOperatingMode) { mode = context.jamClient.getOperatingMode() } + isLatencyTesterMode = mode == 'server'; } connectDeferred = new $.Deferred(); @@ -769,8 +783,8 @@ var jsMessage = JSON.stringify(message); - if( message.type == context.JK.MessageType.PEER_MESSAGE) { - //logger.info("server.send(PEER_MESSAGE)") + if( isLatencyTester() && (message.type == context.JK.MessageType.HEARTBEAT || message.type == context.JK.MessageType.PEER_MESSAGE)) { + logger.info("latency-tester: server.send(" + jsMessage + ")") } else if (message.type != context.JK.MessageType.HEARTBEAT && message.type != context.JK.MessageType.PEER_MESSAGE) { logger.info("server.send(" + jsMessage + ")"); diff --git a/web/app/views/corps/help.html.erb b/web/app/views/corps/help.html.erb index e5d6f7654..930cdf98d 100644 --- a/web/app/views/corps/help.html.erb +++ b/web/app/views/corps/help.html.erb @@ -9,5 +9,5 @@ Desk.com service using your JamKazam credentials, so you won't have to register for a separate support account.

-JamKazam Support +JamKazam Support

\ No newline at end of file diff --git a/web/app/views/users/_user_dropdown.html.erb b/web/app/views/users/_user_dropdown.html.erb index 168c80121..397a80863 100644 --- a/web/app/views/users/_user_dropdown.html.erb +++ b/web/app/views/users/_user_dropdown.html.erb @@ -48,10 +48,10 @@
  • <%= link_to "Affiliate Report", '/client#/account/affiliate' %>
  • <% end %> <% if @nativeClient && Rails.application.config.jamblaster_menu %> -
  • <%= link_to "JamBlaster Settings", '/client#/jamblaster' %>
  • + <% end %> <% if current_user %> -
  • <%= link_to "JamClass", '/client#/jamclass' %>
  • + <% end %>
  • <%= link_to "Invite Friends", '#' %>