Skip to content
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

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

xavdid
Copy link
Contributor

@xavdid xavdid commented Jan 21, 2022

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.

@xavdid xavdid requested a review from eliangcs as a code owner January 21, 2022 23:01
@@ -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
Copy link
Contributor Author

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:
Copy link
Contributor Author

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!

@xavdid
Copy link
Contributor Author

xavdid commented Jan 21, 2022

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?

Copy link
Member

@eliangcs eliangcs left a 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.

@eliangcs
Copy link
Member

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.

@xavdid xavdid merged commit 8a4f334 into master Jan 27, 2022
@xavdid xavdid deleted the PDE-2699 branch January 27, 2022 21:32
xavdid added a commit that referenced this pull request Jan 27, 2022
eliangcs added a commit that referenced this pull request Feb 3, 2022
fix(legacy-scripting-runner): backport #475; handle empty scripting string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants