* VRFS-699 - support notify_release_stages in the javascript bugsnag
* VRFS-704 - suppress music sessions with 0 connections find sess api
* VRFS-700 - the find session API does alot better by suppressing empty
sessions
This commit is contained in:
parent
b7a20555d2
commit
c1ad886c35
|
|
@ -49,7 +49,7 @@ module JamRuby
|
|||
query = MusicSession
|
||||
.joins(
|
||||
%Q{
|
||||
LEFT OUTER JOIN
|
||||
INNER JOIN
|
||||
connections
|
||||
ON
|
||||
music_sessions.id = connections.music_session_id
|
||||
|
|
|
|||
|
|
@ -81,9 +81,13 @@ describe MusicSession do
|
|||
|
||||
it "orders two sessions by created_at starting with most recent" do
|
||||
creator = FactoryGirl.create(:user)
|
||||
|
||||
creator2 = FactoryGirl.create(:user)
|
||||
|
||||
earlier_session = FactoryGirl.create(:music_session, :creator => creator, :description => "Earlier Session")
|
||||
later_session = FactoryGirl.create(:music_session, :creator => creator, :description => "Later Session")
|
||||
FactoryGirl.create(:connection, :user => creator, :music_session => earlier_session)
|
||||
|
||||
later_session = FactoryGirl.create(:music_session, :creator => creator2, :description => "Later Session")
|
||||
FactoryGirl.create(:connection, :user => creator2, :music_session => later_session)
|
||||
|
||||
user = FactoryGirl.create(:user)
|
||||
|
||||
|
|
@ -94,14 +98,18 @@ describe MusicSession do
|
|||
end
|
||||
|
||||
it "orders sessions with inviteds first, even if created first" do
|
||||
creator = FactoryGirl.create(:user)
|
||||
earlier_session = FactoryGirl.create(:music_session, :creator => creator, :description => "Earlier Session")
|
||||
later_session = FactoryGirl.create(:music_session, :creator => creator, :description => "Later Session")
|
||||
creator1 = FactoryGirl.create(:user)
|
||||
creator2 = FactoryGirl.create(:user)
|
||||
|
||||
earlier_session = FactoryGirl.create(:music_session, :creator => creator1, :description => "Earlier Session")
|
||||
FactoryGirl.create(:connection, :user => creator1, :music_session => earlier_session)
|
||||
later_session = FactoryGirl.create(:music_session, :creator => creator2, :description => "Later Session")
|
||||
FactoryGirl.create(:connection, :user => creator2, :music_session => later_session)
|
||||
user = FactoryGirl.create(:user)
|
||||
FactoryGirl.create(:connection, :user => creator, :music_session => earlier_session)
|
||||
FactoryGirl.create(:friendship, :user => creator, :friend => user)
|
||||
FactoryGirl.create(:friendship, :user => user, :friend => creator)
|
||||
FactoryGirl.create(:invitation, :sender => creator, :receiver => user, :music_session => earlier_session)
|
||||
FactoryGirl.create(:connection, :user => creator1, :music_session => earlier_session)
|
||||
FactoryGirl.create(:friendship, :user => creator1, :friend => user)
|
||||
FactoryGirl.create(:friendship, :user => user, :friend => creator1)
|
||||
FactoryGirl.create(:invitation, :sender => creator1, :receiver => user, :music_session => earlier_session)
|
||||
|
||||
music_sessions = MusicSession.index(user)
|
||||
music_sessions.length.should == 2
|
||||
|
|
@ -114,7 +122,10 @@ describe MusicSession do
|
|||
creator1 = FactoryGirl.create(:user)
|
||||
creator2 = FactoryGirl.create(:user)
|
||||
earlier_session = FactoryGirl.create(:music_session, :creator => creator1, :description => "Earlier Session")
|
||||
FactoryGirl.create(:connection, :user => creator1, :music_session => earlier_session)
|
||||
later_session = FactoryGirl.create(:music_session, :creator => creator2, :description => "Later Session")
|
||||
FactoryGirl.create(:connection, :user => creator2, :music_session => later_session)
|
||||
|
||||
user = FactoryGirl.create(:user)
|
||||
FactoryGirl.create(:friendship, :user => creator1, :friend => user)
|
||||
FactoryGirl.create(:friendship, :user => user, :friend => creator1)
|
||||
|
|
@ -152,6 +163,7 @@ describe MusicSession do
|
|||
creator = FactoryGirl.create(:user)
|
||||
genre = FactoryGirl.create(:genre)
|
||||
session = FactoryGirl.create(:music_session, :creator => creator, :description => "Session", :genres => [genre])
|
||||
FactoryGirl.create(:connection, :user => creator, :music_session => session)
|
||||
user = FactoryGirl.create(:user)
|
||||
|
||||
music_sessions = MusicSession.index(user, nil, [genre.id])
|
||||
|
|
@ -196,6 +208,19 @@ describe MusicSession do
|
|||
music_sessions.length.should == 1
|
||||
end
|
||||
|
||||
it "does not list a session if it has no participants" do
|
||||
# it's a design goal that there should be no sessions with 0 connections;
|
||||
# however, this bug continually crops up so the .index method will protect against this common bug
|
||||
|
||||
creator = FactoryGirl.create(:user)
|
||||
session = FactoryGirl.create(:music_session, :creator => creator, :description => "Session")
|
||||
session.connections.delete_all # should leave a bogus, 0 participant session around
|
||||
|
||||
music_sessions = MusicSession.index(creator, nil, nil)
|
||||
music_sessions.length.should == 0
|
||||
|
||||
end
|
||||
|
||||
it "does not list a session if my_bands_only is set and it's not my band" do
|
||||
creator = FactoryGirl.create(:user)
|
||||
session = FactoryGirl.create(:music_session, :creator => creator, :description => "Session")
|
||||
|
|
@ -209,6 +234,7 @@ describe MusicSession do
|
|||
band = FactoryGirl.create(:band)
|
||||
creator = FactoryGirl.create(:user)
|
||||
session = FactoryGirl.create(:music_session, :creator => creator, :description => "Session", :band => band)
|
||||
FactoryGirl.create(:connection, :user => creator, :music_session => session)
|
||||
user = FactoryGirl.create(:user)
|
||||
FactoryGirl.create(:band_musician, :band => band, :user => creator)
|
||||
FactoryGirl.create(:band_musician, :band => band, :user => user)
|
||||
|
|
|
|||
|
|
@ -162,7 +162,8 @@
|
|||
}
|
||||
|
||||
function startSessionLatencyChecks(sessionList) {
|
||||
logger.debug("Starting latency checks");
|
||||
logger.debug("Starting latency checks on " + sessionList.length + " sessions");
|
||||
|
||||
sessionLatency.subscribe(app.clientId, latencyResponse);
|
||||
$.each(sessionList, function(index, session) {
|
||||
sessions[session.id] = session;
|
||||
|
|
@ -217,7 +218,6 @@
|
|||
* sortScore in sessionLatency.
|
||||
*/
|
||||
function renderSession(sessionId) {
|
||||
|
||||
// store session in the appropriate bucket and increment category counts
|
||||
var session = sessions[sessionId];
|
||||
if (containsInvitation(session)) {
|
||||
|
|
|
|||
|
|
@ -13,4 +13,8 @@ module ApplicationHelper
|
|||
def self.base_uri(request)
|
||||
(request.ssl? ? "https://" : "http://") + request.host_with_port
|
||||
end
|
||||
|
||||
def bugsnag?
|
||||
Rails.application.config.bugsnag_notify_release_stages.include? Rails.env
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -23,8 +23,10 @@
|
|||
<%= stylesheet_link_tag "client/search", media: "all" %>
|
||||
<%= stylesheet_link_tag "client/ftue", media: "all" %>
|
||||
<%= stylesheet_link_tag "client/createSession", media: "all" %>
|
||||
<!-- THIS NEEDS TO BE IN FRONT OF ANY OTHER JAVASCRIPT INCLUDES ACCORDING TO BUGSNAG -->
|
||||
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-1.0.9.min.js" data-apikey="<%= Rails.application.config.bugsnag_key %>"></script>
|
||||
<% if bugsnag? %>
|
||||
<!-- THIS NEEDS TO BE IN FRONT OF ANY OTHER JAVASCRIPT INCLUDES ACCORDING TO BUGSNAG -->
|
||||
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-1.0.9.min.js" data-apikey="<%= Rails.application.config.bugsnag_key %>"></script>
|
||||
<% end %>
|
||||
<%= include_gon %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@
|
|||
<![endif]-->
|
||||
<link href='http://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700' rel='stylesheet' type='text/css'>
|
||||
<%= stylesheet_link_tag "client/client", media: "all" %>
|
||||
<!-- THIS NEEDS TO BE IN FRONT OF ANY OTHER JAVASCRIPT INCLUDES ACCORDING TO BUGSNAG -->
|
||||
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-1.0.9.min.js" data-apikey="<%= Rails.application.config.bugsnag_key %>"></script>
|
||||
<% if bugsnag? %>
|
||||
<!-- THIS NEEDS TO BE IN FRONT OF ANY OTHER JAVASCRIPT INCLUDES ACCORDING TO BUGSNAG -->
|
||||
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-1.0.9.min.js" data-apikey="<%= Rails.application.config.bugsnag_key %>"></script>
|
||||
<% end %>
|
||||
<%= include_gon %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
<%= csrf_meta_tags %>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@
|
|||
<link href='http://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700' rel='stylesheet' type='text/css'>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<%= stylesheet_link_tag "corp/corporate", :media => "all" %>
|
||||
<!-- THIS NEEDS TO BE IN FRONT OF ANY OTHER JAVASCRIPT INCLUDES ACCORDING TO BUGSNAG -->
|
||||
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-1.0.9.min.js" data-apikey="<%= Rails.application.config.bugsnag_key %>"></script>
|
||||
<% if bugsnag? %>
|
||||
<!-- THIS NEEDS TO BE IN FRONT OF ANY OTHER JAVASCRIPT INCLUDES ACCORDING TO BUGSNAG -->
|
||||
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-1.0.9.min.js" data-apikey="<%= Rails.application.config.bugsnag_key %>"></script>
|
||||
<% end %>
|
||||
<%= javascript_include_tag "corp/corporate" %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@
|
|||
<![endif]-->
|
||||
<link href='http://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700' rel='stylesheet' type='text/css'>
|
||||
<%= stylesheet_link_tag "landing/landing", media: "all" %>
|
||||
<!-- THIS NEEDS TO BE IN FRONT OF ANY OTHER JAVASCRIPT INCLUDES ACCORDING TO BUGSNAG -->
|
||||
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-1.0.9.min.js" data-apikey="<%= Rails.application.config.bugsnag_key %>"></script>
|
||||
<% if bugsnag? %>
|
||||
<!-- THIS NEEDS TO BE IN FRONT OF ANY OTHER JAVASCRIPT INCLUDES ACCORDING TO BUGSNAG -->
|
||||
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-1.0.9.min.js" data-apikey="<%= Rails.application.config.bugsnag_key %>"></script>
|
||||
<% end %>
|
||||
<%= include_gon %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -150,5 +150,6 @@ if defined?(Bundler)
|
|||
config.allow_force_native_client = true
|
||||
|
||||
config.bugsnag_key = "4289fc981c8ce3eb0969003c4f498b01"
|
||||
config.bugsnag_notify_release_stages = ["production"] # add 'development' if you want to test a bugsnag feature locally
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Bugsnag.configure do |config|
|
||||
config.api_key = Rails.application.config.bugsnag_key
|
||||
config.use_ssl = false
|
||||
config.notify_release_stages = ["production"] # add 'development' if you want to test a feature locally
|
||||
config.notify_release_stages = Rails.application.config.bugsnag_notify_release_stages
|
||||
config.auto_notify = true
|
||||
config.app_version = JamWeb::VERSION
|
||||
end
|
||||
|
|
|
|||
|
|
@ -558,8 +558,9 @@ describe "Music Session API ", :type => :api do
|
|||
|
||||
it "Finds a single open session" do
|
||||
creator = FactoryGirl.create(:user)
|
||||
FactoryGirl.create(:music_session, :creator => creator, :description => "My Session")
|
||||
|
||||
session = FactoryGirl.create(:music_session, :creator => creator, :description => "My Session")
|
||||
client = FactoryGirl.create(:connection, :user => creator, :music_session => session)
|
||||
|
||||
user = FactoryGirl.create(:user)
|
||||
login(user)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue