-
-
Notifications
You must be signed in to change notification settings - Fork 596
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: Parse.Query.subscribe()
does not return a rejected promise on error in Cloud Code Triggers beforeConnect
or beforeSubscribe
#1490
Conversation
Thanks for opening this pull request!
|
Since this is a breaking change, how would you like to proceed - add a temporary Parse Server option (or maybe there is an alternative?) or wait to merge until Parse Server 6? |
Which approach do you think is best? It’s not a major issue so perhaps we can wait |
Can you think of a way to support both for a while without making it a breaking change or adding a Parse Server option? Otherwise up to you, whatever you think is best. Should we add this as a feature or fix? The issue is currently classified as feature. |
Parse.Cloud.beforeSubscribe
rejections to be caught by ParseQuery.subscribe
That would be good |
I will reformat the title to use the proper commit message syntax. |
Parse.Cloud.beforeSubscribe
rejections to be caught by ParseQuery.subscribe
Parse.Cloud.beforeSubscribe
rejections to be caught by ParseQuery.subscribe
Codecov ReportBase: 99.93% // Head: 99.89% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## alpha #1490 +/- ##
==========================================
- Coverage 99.93% 99.89% -0.04%
==========================================
Files 61 61
Lines 5966 5973 +7
Branches 1366 1367 +1
==========================================
+ Hits 5962 5967 +5
- Misses 4 6 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Looks good!
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.
How can be best explain the "breaking" aspect of this change?
Calling
Parse.Query.subscribe()
will now return a rejected promise if an error is thrown in Cloud Code TriggersbeforeConnect
orbeforeSubscribe
; in previous releases a resolved promise was returned, even if subscribing failed and it was necessary to create anerror.on
listener to handle these errors.
Does that make sense?
Yes, that sounds good to me |
Parse.Cloud.beforeSubscribe
rejections to be caught by ParseQuery.subscribe
beforeConnect
or beforeSubscribe
does not reject promise of Parse.Query.subscribe()
beforeConnect
or beforeSubscribe
does not reject promise of Parse.Query.subscribe()
Parse.Query.subscribe()
does not return a rejected promise on error in Cloud Code Triggers beforeConnect
or beforeSubscribe
# [4.0.0-alpha.2](4.0.0-alpha.1...4.0.0-alpha.2) (2022-11-15) ### Bug Fixes * `Parse.Query.subscribe()` does not return a rejected promise on error in Cloud Code Triggers `beforeConnect` or `beforeSubscribe` ([#1490](#1490)) ([96d7174](96d7174)) ### BREAKING CHANGES * Calling `Parse.Query.subscribe()` will now return a rejected promise if an error is thrown in Cloud Code Triggers `beforeConnect` or `beforeSubscribe`; in previous releases a resolved promise was returned, even if subscribing failed and it was necessary to create an `error.on` listener to handle these errors (#1490) ([96d7174](96d7174))
🎉 This change has been released in version 4.0.0-alpha.2 |
The label |
…error in Cloud Code Triggers `beforeConnect` or `beforeSubscribe` (parse-community#1490) BREAKING CHANGE: Calling `Parse.Query.subscribe()` will now return a rejected promise if an error is thrown in Cloud Code Triggers `beforeConnect` or `beforeSubscribe`; in previous releases a resolved promise was returned, even if subscribing failed and it was necessary to create an `error.on` listener to handle these errors (parse-community#1490)
# [4.0.0-alpha.2](parse-community/Parse-SDK-JS@4.0.0-alpha.1...4.0.0-alpha.2) (2022-11-15) ### Bug Fixes * `Parse.Query.subscribe()` does not return a rejected promise on error in Cloud Code Triggers `beforeConnect` or `beforeSubscribe` ([parse-community#1490](parse-community#1490)) ([96d7174](parse-community@96d7174)) ### BREAKING CHANGES * Calling `Parse.Query.subscribe()` will now return a rejected promise if an error is thrown in Cloud Code Triggers `beforeConnect` or `beforeSubscribe`; in previous releases a resolved promise was returned, even if subscribing failed and it was necessary to create an `error.on` listener to handle these errors (parse-community#1490) ([96d7174](96d7174))
# [4.0.0-beta.1](3.5.1...4.0.0-beta.1) (2023-01-23) ### Bug Fixes * `Parse.Query.subscribe()` does not return a rejected promise on error in Cloud Code Triggers `beforeConnect` or `beforeSubscribe` ([#1490](#1490)) ([96d7174](96d7174)) * Remove support for Node <14 ([#1603](#1603)) ([bc04b4b](bc04b4b)) ### Features * Add Node 16 and 18 support ([#1598](#1598)) ([2c79a31](2c79a31)) * Add node 19 support ([8ed0fab](8ed0fab)) * Add Node 19 support ([#1643](#1643)) ([dfb5196](dfb5196)) ### Performance Improvements * Avoid CORS preflight request by removing upload listener when not used ([#1610](#1610)) ([6125419](6125419)) ### BREAKING CHANGES * Calling `Parse.Query.subscribe()` will now return a rejected promise if an error is thrown in Cloud Code Triggers `beforeConnect` or `beforeSubscribe`; in previous releases a resolved promise was returned, even if subscribing failed and it was necessary to create an `error.on` listener to handle these errors (#1490) ([96d7174](96d7174)) * This release removes support for Node versions <14 ([bc04b4b](bc04b4b))
🎉 This change has been released in version 4.0.0-beta.1 |
# [4.0.0](3.5.1...4.0.0) (2023-01-23) ### Bug Fixes * `Parse.Query.subscribe()` does not return a rejected promise on error in Cloud Code Triggers `beforeConnect` or `beforeSubscribe` ([#1490](#1490)) ([96d7174](96d7174)) * Remove support for Node <14 ([#1603](#1603)) ([bc04b4b](bc04b4b)) ### Features * Add Node 16 and 18 support ([#1598](#1598)) ([2c79a31](2c79a31)) * Add node 19 support ([8ed0fab](8ed0fab)) * Add Node 19 support ([#1643](#1643)) ([dfb5196](dfb5196)) ### Performance Improvements * Avoid CORS preflight request by removing upload listener when not used ([#1610](#1610)) ([6125419](6125419)) ### BREAKING CHANGES * Calling `Parse.Query.subscribe()` will now return a rejected promise if an error is thrown in Cloud Code Triggers `beforeConnect` or `beforeSubscribe`; in previous releases a resolved promise was returned, even if subscribing failed and it was necessary to create an `error.on` listener to handle these errors (#1490) ([96d7174](96d7174)) * This release removes support for Node versions <14 ([bc04b4b](bc04b4b))
🎉 This change has been released in version 4.0.0 |
New Pull Request Checklist
Issue Description
Cloud errors thrown from
beforeConnect
andbeforeSubscribe
will now catch, just like errors fromquery.find
Related issue: #1489
Closes #1489
Approach
Throws error to subscription promise if error occurs
TODOs before merging