parse-server
parse-server copied to clipboard
feat: Add trigger `beforeUnsubscribe` for LiveQuery
New Pull Request Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am creating this PR in reference to an issue.
Issue Description
There is a very useful Before Subscribe Trigger, this PR add its counterpart beforeUnsubscribe
Related issue: #7420
Approach
TODOs before merging
- [x] Add test cases
- [x] Add entry to changelog
Thanks for opening this PR.
Please make sure to also open an issue related to this PR.
@mtrezza done.
Codecov Report
Patch coverage: 88.88% and project coverage change: -0.01% :warning:
Comparison is base (
3d6d50e) 94.31% compared to head (5d07966) 94.31%. Report is 1 commits behind head on alpha.
:exclamation: Current head 5d07966 differs from pull request most recent head 1d1660a. Consider uploading reports for the commit 1d1660a to get more accurate results
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
| Files Changed | Coverage Δ | |
|---|---|---|
| src/triggers.js | 95.35% <ø> (ø) |
|
| src/LiveQuery/ParseLiveQueryServer.js | 95.72% <85.71%> (-0.32%) |
:arrow_down: |
| src/cloud-code/Parse.Cloud.js | 99.31% <100.00%> (+0.01%) |
:arrow_up: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@mtrezza I had to commit with --no-verify, the prettier doesn't seems to work, it does with en error saying there Is no files in /src**/
I'll try to have a look later
If you run npm run prettier it should work. But if that causes a lot of changes in files that are unrelated to this PR, please only run it for the files you edited.
Then run npm run lint-fix.
@mtrezza Sadly prettier wont work with the npm run (im using windows)
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
@mtrezza Docs added https://github.com/parse-community/docs/pull/833
This fixes the issue. Do you want a PR ? Should i commit this in this PR ?
I assume that it still works on unix then, yes please go ahead, I'll test it.
To clarify the TODO list, I think we can delete these, because they are irrelevant in this PR:
- Add security check
- Add new Parse Error codes to Parse JS SDK
- Add changes to documentation (guides, repository pages, in-code descriptions)
- ...
This PR just needs this I think, then we can do a final review:
- Add entry to changelog
@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.
@mtrezza ✅ Rebased ✅ Fixed coverage
It seems the changelog entry is still missing, even though the TODO is checked. I've unchecked it. I think if you rebase on master and add the changelog entry, this should be good to go!
@mtrezza Added.
I guess it got lost during a rebase. The commit was there https://github.com/parse-community/parse-server/pull/7419/commits/dc21260a0a213645efea2054b6cfa22a5b9af0fa
@sadortun thanks for the PR! Looks good, just some minor comments.
⚠️ Important change for merging PRs from Parse Server 5.0 onwards!
We are planning to release the first beta version of Parse Server 5.0 in October 2021.
If a PR contains a breaking change and is not merged before the beta release of Parse Server 5.0, it cannot be merged until the end of 2022. Instead it has to follow the Deprecation Policy and phase-in breaking changes to be merged during the course of 2022.
One of the most voiced community feedbacks was the demand for predictability in breaking changes to make it easy to upgrade Parse Server. We have made a first step towards this by introducing the Deprecation Policy in February 2021 that assists to phase-in breaking changes, giving developers time to adapt. We will follow-up with the introduction of Release Automation and a branch model that will allow breaking changes only with a new major release, scheduled for the beginning of each calendar year.
We understand that some PRs are a long time in the making and we very much appreciate your contribution. We want to make it easy for PRs that contain a breaking change and were created before the introduction of the Deprecation Policy. These PRs can be merged with a breaking change without being phased-in before the beta release of Parse Server 5.0. We are making this exception because we appreciate that this is a time of transition that requires additional effort from contributors to adapt. We encourage everyone to prepare their PRs until the end of September and account for review time and possible adaptions.
If a PR contains a breaking change and should be merged before the beta release, please mention @parse-community/server-maintenance and we will coordinate with you to merge the PR.
Thanks for your contribution and support during this transition to Parse Server release automation!
@mtrezza @dblythy
✅ Fixed last discussions ✅ Rebased on master
@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 ~~today~~.
Edit: sorry about the delay(s) I haven't forgotten you!
Thanks for opening this pull request!
- 🎉 We are excited about your hands-on contribution!
@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?
I will reformat the title to use the proper commit message syntax.