Merge branch 'master' into production

This commit is contained in:
Nick Winter 2016-08-24 16:08:08 -07:00
commit 0a3d78454a
7 changed files with 33 additions and 12 deletions

View file

@ -507,6 +507,11 @@ self.onWorldError = function onWorldError(error) {
} }
else { else {
console.log("Non-UserCodeError:", error.toString() + "\n" + error.stack || error.stackTrace); 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()}}); self.postMessage({type: 'non-user-code-problem', problem: {message: error.toString()}});
return false; return false;
} }

View file

@ -234,7 +234,7 @@ module.exports = class Angel extends CocoClass
@running = false @running = false
@work = null @work = null
@streamingWorld = null @streamingWorld = null
@deserializationQueue = null @deserializationQueue = []
_.remove @shared.busyAngels, @ _.remove @shared.busyAngels, @
@abortTimeout = _.delay @fireWorker, @abortTimeoutDuration @abortTimeout = _.delay @fireWorker, @abortTimeoutDuration
@aborting = true @aborting = true
@ -254,7 +254,7 @@ module.exports = class Angel extends CocoClass
@initialized = false @initialized = false
@work = null @work = null
@streamingWorld = null @streamingWorld = null
@deserializationQueue = null @deserializationQueue = []
@hireWorker() if rehire @hireWorker() if rehire
hireWorker: -> hireWorker: ->

View file

@ -196,8 +196,8 @@ module.exports = class User extends CocoModel
group = me.get('testGroupNumber') % 3 group = me.get('testGroupNumber') % 3
@hintsGroup = switch group @hintsGroup = switch group
when 0 then 'no-hints' when 0 then 'no-hints'
when 1 then 'hints' when 1 then 'hints' # Automatically created code, doled out line-by-line, without full solutions
when 2 then 'hintsB' when 2 then 'hintsB' # Manually created FAQ-style hints, reusable across levels
@hintsGroup = 'hints' if me.isAdmin() @hintsGroup = 'hints' if me.isAdmin()
application.tracker.identify hintsGroup: @hintsGroup unless me.isAdmin() application.tracker.identify hintsGroup: @hintsGroup unless me.isAdmin()
@hintsGroup @hintsGroup

View file

@ -139,7 +139,8 @@ module.exports = class TomeView extends CocoView
onSpellLoaded: (e) -> onSpellLoaded: (e) ->
for spellID, spell of @spells for spellID, spell of @spells
return unless spell.loaded return unless spell.loaded
@cast() justBegin = @options.level.isType('game-dev')
@cast false, false, justBegin
onCastSpell: (e) -> onCastSpell: (e) ->
# A single spell is cast. # A single spell is cast.

View file

@ -232,10 +232,10 @@ function getZPContacts(done) {
const emailContactMap = {}; const emailContactMap = {};
for (const contact of contacts) { for (const contact of contacts) {
if (!contact.organization || !contact.name || !contact.email) { if (!contact.organization || !contact.name || !contact.email) {
console.log(JSON.stringify(contact, null, 2)); console.log(`DEBUG: missing data for zp contact ${contact.email}:`);
return done(`DEBUG: missing data for zp contact:`); // console.log(JSON.stringify(contact, null, 2));
} }
if (!emailContactMap[contact.email]) { else if (!emailContactMap[contact.email]) {
emailContactMap[contact.email] = contact; emailContactMap[contact.email] = contact;
} }
// else { // else {

View file

@ -15,11 +15,21 @@ if (process.argv.length !== 7) {
// TODO: update status after adding a call task // TODO: update status after adding a call task
const createTeacherEmailTemplatesAuto1 = ['tmpl_i5bQ2dOlMdZTvZil21bhTx44JYoojPbFkciJ0F560mn', 'tmpl_CEZ9PuE1y4PRvlYiKB5kRbZAQcTIucxDvSeqvtQW57G']; 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 createTeacherInternationalEmailTemplateAuto1 = 'tmpl_8vsXwcr6dWefMnAEfPEcdHaxqSfUKUY8UKq6WfReGqG';
const demoRequestInternationalEmailTemplateAuto1 = 'tmpl_nnH1p3II7G7NJYiPOIHphuj4XUaDptrZk1mGQb2d9Xa'; const demoRequestInternationalEmailTemplateAuto1 = 'tmpl_nnH1p3II7G7NJYiPOIHphuj4XUaDptrZk1mGQb2d9Xa';
const createTeacherEmailTemplatesAuto2 = ['tmpl_pGPtKa07ioISupdSc1MAzNC57K40XoA4k0PI1igi8Ec', 'tmpl_AYAcviU8NQGLbMGKSp3EmcBLha0gQw4cHSOR55Fmoha']; 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 createTeacherInternationalEmailTemplatesAuto2 = ['tmpl_a6Syzzy6ri9MErfXQySM5UfaF5iNIv1VCArYowAEICT', 'tmpl_jOqWLgT0G19Eqs7qZaAeNwtiull7UrSX4ZuvkYRM2gC'];
const demoRequestInternationalEmailTemplatesAuto2 = ['tmpl_wz4SnDZMjNmAhp3MIuZaSMmjJTy5IW75Rcy3MYGb6Ti', 'tmpl_5oJ0YQMZFqNi3DgW7hplD6JS2zHqkB4Gt7Fj1u19Nks']; const demoRequestInternationalEmailTemplatesAuto2 = ['tmpl_wz4SnDZMjNmAhp3MIuZaSMmjJTy5IW75Rcy3MYGb6Ti', 'tmpl_5oJ0YQMZFqNi3DgW7hplD6JS2zHqkB4Gt7Fj1u19Nks'];

View file

@ -14,6 +14,7 @@ if (process.argv.length !== 10) {
// TODO: Reduce response data via _fields param // TODO: Reduce response data via _fields param
// TODO: Assumes 1:1 contact:email relationship (Close.io supports multiple emails for a single contact) // TODO: Assumes 1:1 contact:email relationship (Close.io supports multiple emails for a single contact)
// TODO: Cleanup country/status lookup code // TODO: Cleanup country/status lookup code
// TODO: parallelize update leads
// Save as custom fields instead of user-specific lead notes (also saving nces_ props) // Save as custom fields instead of user-specific lead notes (also saving nces_ props)
const commonTrialProperties = ['organization', 'district', 'city', 'state', 'country']; 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 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 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 createTeacherInternationalEmailTemplateAuto1 = 'tmpl_8vsXwcr6dWefMnAEfPEcdHaxqSfUKUY8UKq6WfReGqG';
const demoRequestInternationalEmailTemplateAuto1 = 'tmpl_nnH1p3II7G7NJYiPOIHphuj4XUaDptrZk1mGQb2d9Xa'; const demoRequestInternationalEmailTemplateAuto1 = 'tmpl_nnH1p3II7G7NJYiPOIHphuj4XUaDptrZk1mGQb2d9Xa';
const createTeacherNlEmailTemplatesAuto1 = ['tmpl_yf9tAPasz8KV7L414GhWWIclU8ewclh3Z8lCx2mCoIU', 'tmpl_OgPCV2p59uq0daVuUPF6r1rcQkxJbViyZ1ZMtW45jY8']; const createTeacherNlEmailTemplatesAuto1 = ['tmpl_yf9tAPasz8KV7L414GhWWIclU8ewclh3Z8lCx2mCoIU', 'tmpl_OgPCV2p59uq0daVuUPF6r1rcQkxJbViyZ1ZMtW45jY8'];
@ -946,7 +951,7 @@ function updateLeads(leads, done) {
tasks.push(createFindExistingLeadFn(email.toLowerCase(), name.toLowerCase(), existingLeads)); tasks.push(createFindExistingLeadFn(email.toLowerCase(), name.toLowerCase(), existingLeads));
} }
} }
async.series(tasks, (err, results) => { async.parallel(tasks, (err, results) => {
if (err) return done(err); if (err) return done(err);
const tasks = []; const tasks = [];
for (const name in leads) { for (const name in leads) {