Not sending HipChat messages for level load errors. Not sending level load errors for level editor loads. Not sending more than one level load error report per session.
This commit is contained in:
parent
3072e5f198
commit
b7d1ab2b01
2 changed files with 9 additions and 4 deletions
|
@ -7,6 +7,8 @@ CocoClass = require 'core/CocoClass'
|
||||||
GoalManager = require 'lib/world/GoalManager'
|
GoalManager = require 'lib/world/GoalManager'
|
||||||
{sendContactMessage} = require 'core/contact'
|
{sendContactMessage} = require 'core/contact'
|
||||||
|
|
||||||
|
reportedLoadErrorAlready = false
|
||||||
|
|
||||||
module.exports = class Angel extends CocoClass
|
module.exports = class Angel extends CocoClass
|
||||||
@nicks: ['Archer', 'Lana', 'Cyril', 'Pam', 'Cheryl', 'Woodhouse', 'Ray', 'Krieger']
|
@nicks: ['Archer', 'Lana', 'Cyril', 'Pam', 'Cheryl', 'Woodhouse', 'Ray', 'Krieger']
|
||||||
|
|
||||||
|
@ -180,6 +182,8 @@ module.exports = class Angel extends CocoClass
|
||||||
@fireWorker()
|
@fireWorker()
|
||||||
|
|
||||||
reportLoadError: ->
|
reportLoadError: ->
|
||||||
|
return if me.isAdmin() or /dev=true/.test(window.location?.href ? '') or reportedLoadErrorAlready
|
||||||
|
reportedLoadErrorAlready = true
|
||||||
context = email: me.get('email')
|
context = email: me.get('email')
|
||||||
context.message = "Automatic Report - Unable to Load Level\nLogs:\n" + @allLogs.join('\n')
|
context.message = "Automatic Report - Unable to Load Level\nLogs:\n" + @allLogs.join('\n')
|
||||||
if $.browser
|
if $.browser
|
||||||
|
@ -187,7 +191,7 @@ module.exports = class Angel extends CocoClass
|
||||||
context.screenSize = "#{screen?.width ? $(window).width()} x #{screen?.height ? $(window).height()}"
|
context.screenSize = "#{screen?.width ? $(window).width()} x #{screen?.height ? $(window).height()}"
|
||||||
context.subject = "Level Load Error: #{@work?.level?.name or 'Unknown Level'}"
|
context.subject = "Level Load Error: #{@work?.level?.name or 'Unknown Level'}"
|
||||||
context.levelSlug = @work?.level?.slug
|
context.levelSlug = @work?.level?.slug
|
||||||
sendContactMessage context unless me.isAdmin()
|
sendContactMessage context
|
||||||
|
|
||||||
doWork: ->
|
doWork: ->
|
||||||
return if @aborting
|
return if @aborting
|
||||||
|
|
|
@ -66,9 +66,10 @@ createMailContext = (req, done) ->
|
||||||
context.email_data.content += "\n<img src='#{req.body.screenshotURL}' />"
|
context.email_data.content += "\n<img src='#{req.body.screenshotURL}' />"
|
||||||
done context
|
done context
|
||||||
|
|
||||||
if /Level Load Error/.test context.email_data.subject
|
# I'll try having it just send the emails instead of spamming the chat.
|
||||||
message = "#{user.get('name') or user.get('email')} saw #{context.email_data.subject} <a href=\"http://direct.codecombat.com/editor/level/#{req.body.levelSlug}\">(level editor)</a>"
|
#if /Level Load Error/.test context.email_data.subject
|
||||||
hipchat.sendHipChatMessage message, ['tower'], color: 'red'
|
# message = "#{user.get('name') or user.get('email')} saw #{context.email_data.subject} <a href=\"http://direct.codecombat.com/editor/level/#{req.body.levelSlug}\">(level editor)</a>"
|
||||||
|
# hipchat.sendHipChatMessage message, ['tower'], color: 'red'
|
||||||
|
|
||||||
|
|
||||||
fetchRecentSessions = (user, context, callback) ->
|
fetchRecentSessions = (user, context, callback) ->
|
||||||
|
|
Reference in a new issue