feat: Add trigger beforeUnsubscribe for LiveQuery#7419
feat: Add trigger beforeUnsubscribe for LiveQuery#7419sadortun wants to merge 8 commits intoparse-community:alphafrom
beforeUnsubscribe for LiveQuery#7419Conversation
21034a7 to
2e70b92
Compare
|
Thanks for opening this PR. Please make sure to also open an issue related to this PR. |
|
@mtrezza done. |
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. |
mtrezza
left a comment
There was a problem hiding this comment.
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 |
dblythy
left a comment
There was a problem hiding this comment.
Looks really good! Only a minor nit
| 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.
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.
@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
|
Any progress on this PR? |
|
@mbfakourii I don't have write access to this PR, so the PR author @sadortun would need to merge the base branch for the CI to run. Alternatively, someone could use this branch and open their own PR to continue make it ready for the CI. |
New Pull Request Checklist
Issue Description
There is a very useful Before Subscribe Trigger, this PR add its counterpart
beforeUnsubscribeRelated issue: #7420
Approach
TODOs before merging