mozilla / fxa-amplitude-send

Data pipeline scripts for importing Firefox Accounts event data to Amplitude.
Mozilla Public License 2.0
7 stars 9 forks source link

fix(scripts): fix undefined dereference in marketing import #91

Closed philbooth closed 5 years ago

philbooth commented 5 years ago

Noticed this while working on #90.

As per the docs, async.cargo does not pass a callback argument to async functions:

Wherever we accept a Node-style async function, we also directly accept an ES2017 async function. In this case, the async function will not be passed a final callback argument, and any thrown error will be used as the err argument of the implicit callback, and the return value will be used as the result value.

The marketing script was attempting to call callback(), which is actually undefined. It wasn't affecting the import itself because the request has already succeeded at that point, but it meant the script wasn't exiting gracefully.

Also did an npm audit fix.

@jbuck r?