-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat: Add trigger beforeUnsubscribe
for LiveQuery
#7419
base: alpha
Are you sure you want to change the base?
feat: Add trigger beforeUnsubscribe
for LiveQuery
#7419
Conversation
21034a7
to
2e70b92
Compare
Thanks for opening this PR. Please make sure to also open an issue related to this PR. |
@mtrezza done. |
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.
Approved too quickly...
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.
Just needs a lint-fix it seems.
And can you add a test for this new trigger?
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## alpha #7419 +/- ##
==========================================
- Coverage 94.31% 94.31% -0.01%
==========================================
Files 186 186
Lines 14770 14786 +16
==========================================
+ Hits 13931 13946 +15
- Misses 839 840 +1
☔ View full report in Codecov by Sentry. |
@mtrezza I had to commit with I'll try to have a look later |
If you run |
@mtrezza Sadly This fixes the issue. Do you want a PR ? Should i commit this in this PR ? - prettier --write '{src,spec}/{**/*,*}.js'
+ prettier --write {src,spec}/{**/*,*}.js |
c480f3d
to
1ae5c56
Compare
@mtrezza Docs added parse-community/docs#833 |
I assume that it still works on unix then, yes please go ahead, I'll test it. |
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.
LGTM! @mtrezza anything you want to add?
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. Can you please update the ToDo list and check if we have things like changelog entry.
To clarify the TODO list, I think we can delete these, because they are irrelevant in this PR:
This PR just needs this I think, then we can do a final review:
|
@mtrezza Changelog entry added |
@sadortun I removed the n/a TODOs from the post. To clarify, TODOs that do not apply to a PR are removed, not checked, otherwise a reviewer may think you actually made these changes. |
Can you take a look at the coverage for src/LiveQuery/ParseLiveQueryServer.js#L848? https://github.com/parse-community/parse-server/pull/7419/checks?check_run_id=2881789028 |
@sadortun Would you mind rebasing this on master and make sure the coverage is fine? I think this will be good to merge then. |
Ofc, sorry about the delayS, on this and others PRs !! |
No worries, thanks for looking into this. |
I have removed myself from review for now. Please feel free to request again when the merge conflicts are resolved. |
82998d2
to
1ed8d05
Compare
@mtrezza |
|
f53bdca
to
4bcaf93
Compare
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 amazing to me!
Let's see what @dblythy says, nothing escapes his eyes usually.
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 really good! Only a minor nit
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.
Nice job @sadortun! Sorry I didn't realise that there were other hard coded errors in the file and you were just copying the formatting. We should fix that in a different PR
Actually, a few other things:
const className = subscription.className; | ||
const trigger = getTrigger(className, 'beforeUnsubscribe', Parse.applicationId); | ||
if (trigger) { | ||
const auth = await this.getAuthFromClient(client, request.requestId, request.sessionToken); |
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.
In the other uses, getAuthFromClient
is wrapped in the try / catch block. I don't think it throws, but could you add it to the try / catch, or add a test case for beforeUnsubscribe
without the user.signUp
?
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.
@sadortun Could you address this comment, then I believe this should be good to merge.
@sadortun Do you think we could get this ready for merge? |
Ah, sorry, i was sure it was already merged ! I'll have a look later Edit: sorry about the delay(s) I haven't forgotten you! |
Thanks for opening this pull request!
|
beforeUnsubscribe
for LiveQuery
@sadortun came across this PR; it looks almost ready to merge; would you want to take another look at the open comments, so we can merge this? |
ab796c2
to
d2c37b0
Compare
I will reformat the title to use the proper commit message syntax. |
beforeUnsubscribe
for LiveQuerybeforeUnsubscribe
for LiveQuery
New Pull Request Checklist
Issue Description
There is a very useful Before Subscribe Trigger, this PR add its counterpart
beforeUnsubscribe
Related issue: #7420
Approach
TODOs before merging