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: Promise finally error for perspectiveSave #43

Merged
merged 1 commit into from Jun 1, 2022

Conversation

martin-brennan
Copy link
Contributor

@martin-brennan martin-brennan commented Jun 1, 2022

There are some cases when the .save() call within
.perspectiveSave() would return null instead of a promise,
causing an error. We return null sometimes in core from
this function, so we just check whether the result is null
or a promise and act accordingly.

Also adds some tests and does some minor refactoring.

c.f. https://meta.discourse.org/t/javascript-error-in-google-perspective-api-plugin/226732

@martin-brennan martin-brennan force-pushed the issue/fix-promise-finally-error branch from 9dfa0e9 to 270124d Compare June 1, 2022 05:44
@martin-brennan martin-brennan force-pushed the issue/fix-promise-finally-error branch from 270124d to f6b750e Compare June 1, 2022 06:26
@martin-brennan martin-brennan force-pushed the issue/fix-promise-finally-error branch 2 times, most recently from 3273472 to 14fc7d2 Compare June 1, 2022 06:39
There are some cases when the .save() call within
.perspectiveSave() would return null instead of a promise,
causing an error. We return null sometimes in core from
this function, so we just check whether the result is null
or a promise and act accordingly.

Also adds some tests and does some minor refactoring.
@martin-brennan martin-brennan force-pushed the issue/fix-promise-finally-error branch from 14fc7d2 to 5d997d7 Compare June 1, 2022 06:41
@martin-brennan martin-brennan merged commit 9f597fa into main Jun 1, 2022
@martin-brennan martin-brennan deleted the issue/fix-promise-finally-error branch June 1, 2022 06:46
tgxworld added a commit that referenced this pull request Jun 1, 2022
tgxworld added a commit that referenced this pull request Jun 1, 2022
This reverts commit 9f597fa.

We suspect this commit is causing our plugin JS tests to fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants