A TypeError is triggered on herokuapp (but not on stage/prod) after scanning a [email protected] email address
[Affected versions]:
- latest Nightly 64.0a1
- Beta 63.0b3
- RC 62.0
[Affected platforms]:
- Windows 10 x64
- macOS 10.13
- Ubuntu 16.04 x64
[Steps to reproduce]:
- Launch Firefox.
- Navigate to https://fx-breach-alerts.herokuapp.com/
- Scan an email address that respects the following structure: [email protected] e.g. [email protected], [email protected], [email protected]
[Expected result]:
- Positive or negative results are displayed on the page depending of the email scanned.
[Actual result]:
- The following error is triggered:
TypeError: [scan.hbs] dataClasses.join is not a function at Object.<anonymous> (/app/hbs-helpers.js:12:26) at Object.eval [as main] (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:18:92) at main (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:173:32) at ret (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:12) at ret (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:525:21) at Object.invokePartial (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:273:12) at Object.invokePartialWrapper [as invokePartial] (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:68:39) at eval (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:6:28) at Object.prog [as fn] (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:219:12) at Object.<anonymous> (/app/hbs-helpers.js:26:29) at eval (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:6:101) at Object.prog [as fn] (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:219:12) at Object.<anonymous> (/app/hbs-helpers.js:43:26) at eval (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:8:82) at Object.prog [as fn] (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:219:12) at Object.<anonymous> (/app/hbs-helpers.js:43:26)
[Regression range]:
- It seems to be a regression since I cannot reproduce this on https://blurts-server.stage.mozaws.net/
[Additional notes]:
- please note that this issue (as stated above) does not reproduce on stage.
Interesting... I think Troy was showing some stack trace recently via Postman when we were load testing that showed something similar. Looks like we may need some better error handling. Or, if we know why why/where this is happening, it'd be nice to confirm if it only happens on Heroku dev instance and not in stage/prod, since leaking stack info can sometimes be risky (and a super bad user experience).
TypeError: [scan.hbs] dataClasses.join is not a function
at Object.<anonymous> (/app/hbs-helpers.js:12:26)
at Object.eval [as main] (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:18:92)
at main (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:173:32)
at ret (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:12)
at ret (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:525:21)
at Object.invokePartial (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:273:12)
at Object.invokePartialWrapper [as invokePartial] (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:68:39)
at eval (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:6:28)
at Object.prog [as fn] (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:219:12)
at Object.<anonymous> (/app/hbs-helpers.js:26:29)
at eval (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:6:86)
at Object.prog [as fn] (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:219:12)
at Object.<anonymous> (/app/hbs-helpers.js:43:26)
at Object.eval [as main] (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:5:100)
at main (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:173:32)
at ret (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:12)
Failing code is
https://github.com/mozilla/blurts-server/blob/bf2066306929cc5a7c4ab72f4436a5ac3fb0da96/hbs-helpers.js#L11-L13
Possibly via
https://github.com/mozilla/blurts-server/blob/bf2066306929cc5a7c4ab72f4436a5ac3fb0da96/views/partials/featured_breach.hbs#L10
... or
https://github.com/mozilla/blurts-server/blob/bf2066306929cc5a7c4ab72f4436a5ac3fb0da96/views/partials/breach_listing.hbs#L9
$ git grep -n --break --heading breachDataClasses
hbs-helpers.js
11: hbs.registerHelper("breachDataClasses", function(dataClasses) {
views/partials/breach_listing.hbs
9: <span class="breach-info"><span class="medium">Compromised data:</span> {{breachDataClasses DataClasses }}</span>
views/partials/featured_breach.hbs
10: <span class="breach-info"><span class="medium">Compromised Data</span> {{breachDataClasses featuredBreach.DataClasses }}</span>
Verified fixed on 62.0 (20180830143136) running Windows 10 x64, macOS 10.13 and Ubuntu 16.04 x64.