* finish out crash notification
This commit is contained in:
parent
7ca4de12d7
commit
922cfc4540
|
|
@ -317,4 +317,5 @@ purchasable_gift_cards.sql
|
|||
versionable_jamtracks.sql
|
||||
session_controller.sql
|
||||
jam_tracks_bpm.sql
|
||||
jam_track_sessions.sql
|
||||
jam_track_sessions.sql
|
||||
jam_track_sessions_v2.sql
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE jam_track_sessions ALTER COLUMN user_id DROP NOT NULL;
|
||||
ALTER TABLE crash_dumps ALTER COLUMN user_id DROP NOT NULL;
|
||||
|
|
@ -17,7 +17,7 @@ module JamRuby
|
|||
before_validation(:on => :create) do
|
||||
self.created_at ||= Time.now
|
||||
self.id = SecureRandom.uuid
|
||||
self.uri = "dumps/#{created_at.strftime('%Y-%m-%d')}/#{self.id}"
|
||||
self.uri = "dumps/#{created_at.strftime('%Y-%m-%d')}/#{self.id}.zip"
|
||||
end
|
||||
|
||||
def user_email
|
||||
|
|
|
|||
|
|
@ -593,10 +593,12 @@ ApiUsersController < ApiController
|
|||
# user_id is deduced if possible from the user's cookie.
|
||||
@dump = CrashDump.new
|
||||
|
||||
user = User.find_by_id(params[:user_id])
|
||||
|
||||
@dump.client_type = params[:client_type]
|
||||
@dump.client_version = params[:client_version]
|
||||
@dump.client_id = params[:client_id]
|
||||
@dump.user_id = params[:user_id]
|
||||
@dump.user_id = user.id if user
|
||||
@dump.session_id = params[:session_id]
|
||||
@dump.timestamp = params[:timestamp]
|
||||
@dump.description = params[:description]
|
||||
|
|
@ -626,12 +628,27 @@ ApiUsersController < ApiController
|
|||
|
||||
logger.debug("crash_dump can read from url #{read_url}")
|
||||
|
||||
body = "Client crash for user #{current_user.email} (#{current_user.name})\n"
|
||||
body << "Client type: #{@dump.client_type}"
|
||||
body << "Client version: #{@dump.client_version}"
|
||||
body << "Download at: #{read_url}\n"
|
||||
body << "User admin url: #{current_user.admin_url}"
|
||||
AdminMailer.crash_alert(subject: "Crash for #{@dump.client_type} #{current_user.email} (#{current_user.name})", body:body)
|
||||
|
||||
if user
|
||||
body = "Client crash for user #{user.email} (#{user.name})\n"
|
||||
body << "Client type: #{@dump.client_type}\n"
|
||||
body << "Client version: #{@dump.client_version}\n"
|
||||
body << "Download at: #{read_url}\n"
|
||||
body << "User admin url: #{user.admin_url}\n"
|
||||
|
||||
subject = "Crash for #{@dump.client_type} - #{user.email} (#{user.name})"
|
||||
else
|
||||
body = "Client crash for unknown user\n"
|
||||
body << "Client type: #{@dump.client_type}\n"
|
||||
body << "Client version: #{@dump.client_version}\n"
|
||||
body << "Download at: #{read_url}\n"
|
||||
|
||||
subject = "Crash for #{@dump.client_type} - unknown user)"
|
||||
end
|
||||
|
||||
logger.debug("sending crash email with subject#{subject}")
|
||||
AdminMailer.crash_alert(subject: subject, body:body).deliver
|
||||
|
||||
redirect_to write_url, status: 307
|
||||
else
|
||||
# we should store it here to aid in development, but we don't have to until someone wants the feature
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ SampleApp::Application.configure do
|
|||
config.video_available= ENV['VIDEO_AVAILABILITY'] || "full"
|
||||
config.email_generic_from = 'nobody-dev@jamkazam.com'
|
||||
config.email_alerts_alias = ENV['ALERT_EMAIL'] || 'alerts-dev@jamkazam.com'
|
||||
config.email_crashes_alias = ENV['ALERT_EMAIL'] || 'clientcrash@jamkazam.com'
|
||||
config.email_crashes_alias = ENV['ALERT_EMAIL'] || 'clientcrash-dev@jamkazam.com'
|
||||
config.email_social_alias = ENV['ALERT_EMAIL'] || 'social-dev@jamkazam.com'
|
||||
config.guard_against_fraud = true
|
||||
config.guard_against_browser_fraud = false
|
||||
|
|
|
|||
Loading…
Reference in New Issue