diff --git a/app/assets/javascripts/workers/worker_world.js b/app/assets/javascripts/workers/worker_world.js index 7cb6da6a6..d2eef4170 100644 --- a/app/assets/javascripts/workers/worker_world.js +++ b/app/assets/javascripts/workers/worker_world.js @@ -507,6 +507,11 @@ self.onWorldError = function onWorldError(error) { } else { console.log("Non-UserCodeError:", error.toString() + "\n" + error.stack || error.stackTrace); + if(self.world.indefiniteLength) { + // We don't abort completely, since the player can always click to end the game. + // TODO: some better error to the user would be nice, though. + return true; + } self.postMessage({type: 'non-user-code-problem', problem: {message: error.toString()}}); return false; } diff --git a/app/lib/Angel.coffee b/app/lib/Angel.coffee index d440a3086..3b2b94045 100644 --- a/app/lib/Angel.coffee +++ b/app/lib/Angel.coffee @@ -234,7 +234,7 @@ module.exports = class Angel extends CocoClass @running = false @work = null @streamingWorld = null - @deserializationQueue = null + @deserializationQueue = [] _.remove @shared.busyAngels, @ @abortTimeout = _.delay @fireWorker, @abortTimeoutDuration @aborting = true @@ -254,7 +254,7 @@ module.exports = class Angel extends CocoClass @initialized = false @work = null @streamingWorld = null - @deserializationQueue = null + @deserializationQueue = [] @hireWorker() if rehire hireWorker: -> diff --git a/app/models/User.coffee b/app/models/User.coffee index 3d2b1f15b..e9705f3db 100644 --- a/app/models/User.coffee +++ b/app/models/User.coffee @@ -196,8 +196,8 @@ module.exports = class User extends CocoModel group = me.get('testGroupNumber') % 3 @hintsGroup = switch group when 0 then 'no-hints' - when 1 then 'hints' - when 2 then 'hintsB' + when 1 then 'hints' # Automatically created code, doled out line-by-line, without full solutions + when 2 then 'hintsB' # Manually created FAQ-style hints, reusable across levels @hintsGroup = 'hints' if me.isAdmin() application.tracker.identify hintsGroup: @hintsGroup unless me.isAdmin() @hintsGroup diff --git a/app/views/play/level/tome/TomeView.coffee b/app/views/play/level/tome/TomeView.coffee index aebf5fb27..a57e3873f 100644 --- a/app/views/play/level/tome/TomeView.coffee +++ b/app/views/play/level/tome/TomeView.coffee @@ -139,7 +139,8 @@ module.exports = class TomeView extends CocoView onSpellLoaded: (e) -> for spellID, spell of @spells return unless spell.loaded - @cast() + justBegin = @options.level.isType('game-dev') + @cast false, false, justBegin onCastSpell: (e) -> # A single spell is cast. diff --git a/scripts/addZenProspectLeadsToClose.js b/scripts/addZenProspectLeadsToClose.js index ce44237d6..ea2c2749d 100644 --- a/scripts/addZenProspectLeadsToClose.js +++ b/scripts/addZenProspectLeadsToClose.js @@ -232,10 +232,10 @@ function getZPContacts(done) { const emailContactMap = {}; for (const contact of contacts) { if (!contact.organization || !contact.name || !contact.email) { - console.log(JSON.stringify(contact, null, 2)); - return done(`DEBUG: missing data for zp contact:`); + console.log(`DEBUG: missing data for zp contact ${contact.email}:`); + // console.log(JSON.stringify(contact, null, 2)); } - if (!emailContactMap[contact.email]) { + else if (!emailContactMap[contact.email]) { emailContactMap[contact.email] = contact; } // else { diff --git a/scripts/followupCloseIoLeads.js b/scripts/followupCloseIoLeads.js index dde6feb4b..1334c605a 100644 --- a/scripts/followupCloseIoLeads.js +++ b/scripts/followupCloseIoLeads.js @@ -15,11 +15,21 @@ if (process.argv.length !== 7) { // TODO: update status after adding a call task const createTeacherEmailTemplatesAuto1 = ['tmpl_i5bQ2dOlMdZTvZil21bhTx44JYoojPbFkciJ0F560mn', 'tmpl_CEZ9PuE1y4PRvlYiKB5kRbZAQcTIucxDvSeqvtQW57G']; -const demoRequestEmailTemplatesAuto1 = ['tmpl_s7BZiydyCHOMMeXAcqRZzqn0fOtk0yOFlXSZ412MSGm', 'tmpl_cGb6m4ssDvqjvYd8UaG6cacvtSXkZY3vj9b9lSmdQrf']; +const demoRequestEmailTemplatesAuto1 = [ + 'tmpl_s7BZiydyCHOMMeXAcqRZzqn0fOtk0yOFlXSZ412MSGm', // (Auto1) Demo Request Long + 'tmpl_cGb6m4ssDvqjvYd8UaG6cacvtSXkZY3vj9b9lSmdQrf', // (Auto1) Demo Request Short + 'tmpl_2hV6OdOXtsObLQK9qlRdpf0C9QKbER06T17ksGYOoUE', // (Auto1) Demo Request With Questions + 'tmpl_Q0tweZ5H4xs2E489KwdYj3HET9PpzkQ7jgDQb9hOMTR', // (Auto1) Demo Request Without Questions +]; const createTeacherInternationalEmailTemplateAuto1 = 'tmpl_8vsXwcr6dWefMnAEfPEcdHaxqSfUKUY8UKq6WfReGqG'; const demoRequestInternationalEmailTemplateAuto1 = 'tmpl_nnH1p3II7G7NJYiPOIHphuj4XUaDptrZk1mGQb2d9Xa'; const createTeacherEmailTemplatesAuto2 = ['tmpl_pGPtKa07ioISupdSc1MAzNC57K40XoA4k0PI1igi8Ec', 'tmpl_AYAcviU8NQGLbMGKSp3EmcBLha0gQw4cHSOR55Fmoha']; -const demoRequestEmailTemplatesAuto2 = ['tmpl_HJ5zebh1SqC1QydDto05VPUMu4F7i5M35Llq7bzgfTw', 'tmpl_dmnK7IVpkyYfPYAl1rChhm9lClH5lJ9pQAZoPr7cvLt']; +const demoRequestEmailTemplatesAuto2 = [ + 'tmpl_dmnK7IVpkyYfPYAl1rChhm9lClH5lJ9pQAZoPr7cvLt', // (Auto2) Demo Request Long + 'tmpl_HJ5zebh1SqC1QydDto05VPUMu4F7i5M35Llq7bzgfTw', // (Auto2) Demo Request Short + 'tmpl_oMH8Gqsh3dPl17FsBrz8dIF14sfTiySASDkmzyRlpWg', // (Auto2) Demo Request With Questions + 'tmpl_JuuQsQhWNpDMYmN9rwD5Kk7oBELVZI4fMmJNUQC7A8j', // (Auto2) Demo Request Without Questions +]; const createTeacherInternationalEmailTemplatesAuto2 = ['tmpl_a6Syzzy6ri9MErfXQySM5UfaF5iNIv1VCArYowAEICT', 'tmpl_jOqWLgT0G19Eqs7qZaAeNwtiull7UrSX4ZuvkYRM2gC']; const demoRequestInternationalEmailTemplatesAuto2 = ['tmpl_wz4SnDZMjNmAhp3MIuZaSMmjJTy5IW75Rcy3MYGb6Ti', 'tmpl_5oJ0YQMZFqNi3DgW7hplD6JS2zHqkB4Gt7Fj1u19Nks']; diff --git a/scripts/updateCloseIoLeads.js b/scripts/updateCloseIoLeads.js index 6a1ca5d9f..2c79b09d1 100644 --- a/scripts/updateCloseIoLeads.js +++ b/scripts/updateCloseIoLeads.js @@ -14,6 +14,7 @@ if (process.argv.length !== 10) { // TODO: Reduce response data via _fields param // TODO: Assumes 1:1 contact:email relationship (Close.io supports multiple emails for a single contact) // TODO: Cleanup country/status lookup code +// TODO: parallelize update leads // Save as custom fields instead of user-specific lead notes (also saving nces_ props) const commonTrialProperties = ['organization', 'district', 'city', 'state', 'country']; @@ -30,7 +31,11 @@ const customFieldsToRemove = [ const leadsToSkip = ['6 sınıflar', 'fdsafd', 'ashtasht', 'matt+20160404teacher3 school', 'sdfdsf', 'ddddd', 'dsfadsaf', "Nolan's School of Wonders", 'asdfsadf']; const createTeacherEmailTemplatesAuto1 = ['tmpl_i5bQ2dOlMdZTvZil21bhTx44JYoojPbFkciJ0F560mn', 'tmpl_CEZ9PuE1y4PRvlYiKB5kRbZAQcTIucxDvSeqvtQW57G']; -const demoRequestEmailTemplatesAuto1 = ['tmpl_s7BZiydyCHOMMeXAcqRZzqn0fOtk0yOFlXSZ412MSGm', 'tmpl_cGb6m4ssDvqjvYd8UaG6cacvtSXkZY3vj9b9lSmdQrf']; +const demoRequestEmailTemplatesAuto1 = [ + 'tmpl_cGb6m4ssDvqjvYd8UaG6cacvtSXkZY3vj9b9lSmdQrf', // (Auto1) Demo Request Short + 'tmpl_2hV6OdOXtsObLQK9qlRdpf0C9QKbER06T17ksGYOoUE', // (Auto1) Demo Request With Questions + 'tmpl_Q0tweZ5H4xs2E489KwdYj3HET9PpzkQ7jgDQb9hOMTR', // (Auto1) Demo Request Without Questions +]; const createTeacherInternationalEmailTemplateAuto1 = 'tmpl_8vsXwcr6dWefMnAEfPEcdHaxqSfUKUY8UKq6WfReGqG'; const demoRequestInternationalEmailTemplateAuto1 = 'tmpl_nnH1p3II7G7NJYiPOIHphuj4XUaDptrZk1mGQb2d9Xa'; const createTeacherNlEmailTemplatesAuto1 = ['tmpl_yf9tAPasz8KV7L414GhWWIclU8ewclh3Z8lCx2mCoIU', 'tmpl_OgPCV2p59uq0daVuUPF6r1rcQkxJbViyZ1ZMtW45jY8']; @@ -946,7 +951,7 @@ function updateLeads(leads, done) { tasks.push(createFindExistingLeadFn(email.toLowerCase(), name.toLowerCase(), existingLeads)); } } - async.series(tasks, (err, results) => { + async.parallel(tasks, (err, results) => { if (err) return done(err); const tasks = []; for (const name in leads) {