From f391030b44ddeaad9d7bb04253cc63e5b689d6d5 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Wed, 24 Aug 2016 12:05:40 -0700 Subject: [PATCH 1/4] Add hints test group distinction comments --- app/models/User.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From d85cfcaddf892818818f9d45ad6e5e0c79496f72 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Wed, 24 Aug 2016 14:33:47 -0700 Subject: [PATCH 2/4] Update zp -> close import script to be more forgiving --- scripts/addZenProspectLeadsToClose.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 { From 80f8fd60d8009a09d6ea6badb964a9ed6e277193 Mon Sep 17 00:00:00 2001 From: Matt Lott Date: Wed, 24 Aug 2016 14:46:15 -0700 Subject: [PATCH 3/4] Update close automated emails --- scripts/followupCloseIoLeads.js | 14 ++++++++++++-- scripts/updateCloseIoLeads.js | 9 +++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) 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) { From 878dcbdc4947b53336e97744103a2b7c0425778c Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 24 Aug 2016 15:21:09 -0700 Subject: [PATCH 4/4] Better handling of non-user-code problems in game-dev mode. Don't simulate whole level first time a game-dev level is loaded. --- app/assets/javascripts/workers/worker_world.js | 5 +++++ app/lib/Angel.coffee | 4 ++-- app/views/play/level/tome/TomeView.coffee | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) 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/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.