-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): handle case where scriptingSource is an empty string #475
Conversation
@@ -31,7 +31,7 @@ | |||
|
|||
- At runtime, a developer's `perform` function is invoked with the following signature: `perform(z, bundle)`. | |||
- The `z` object is a collection of functions used commonly by developers and is defined in `core/src/tools/create-lambda-handler.js` | |||
- Its functions are either Zapier-specific (such as `z.cursor` and `z.dehyrate`) or wrappers around common JS functionality (such as `z.JSON.parse` and `z.console.log`) with better error handling or extra logging | |||
- Its functions are either Zapier-specific (such as `z.cursor` and `z.dehydrate`) or wrappers around common JS functionality (such as `z.JSON.parse` and `z.console.log`) with better error handling or extra logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated typo
@@ -8,8 +8,11 @@ const semver = require('semver'); | |||
const createLegacyScriptingRunner = (z, input) => { | |||
const app = _.get(input, '_zapier.app'); | |||
|
|||
let source = | |||
_.get(app, 'legacy.scriptingSource') || app.legacyScriptingSource; | |||
// once we have node 14 everywhere, this can be: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node 12 is EOL may 2022, so not too long!
re: failing tests, I was looking at them today and they all passed normally on node 12 & 14 on my local. Maybe GH actions is slower and needs a bigger timeout? Each failing run, it's been a different combination of test & node version failing, so maybe we're just getting unlucky. None of the other tests take near 2 min, but it's possible there's a lot of variance there? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! We probably need to backport this to 9.x. To do that, make a new branch based off release-9.x
, make the changes, and create a PR merging to release-9.x
.
Regarding the test timeout, I guess the jobs are more likely to timeout when they are run in parallel on GitHub Actions. And I agree, we could try a bigger time limit first. |
fix(legacy-scripting-runner): backport #475; handle empty scripting string
Handle a rare case where
legacy.scriptingSource
is an empty string on a legacy app, so we don't initialize LSR. Then,z.legacyScripting.run(...)
fails w/Cannot read property 'run' of undefined
.