docs: Add beforeLiveQueryEvent trigger#977
Conversation
Documents the new beforeLiveQueryEvent Cloud Code trigger added in parse-community/parse-server#9445 (closes parse-community/parse-server#9431). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds Cloud Code documentation for ChangesLiveQuery trigger documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Documents the new beforeLiveQueryEvent Cloud Code trigger for Parse Server LiveQuery, explaining when it runs and how returning false can prevent LiveQuery event publishing to reduce unnecessary load.
Changes:
- Adds a new
beforeLiveQueryEventsection under LiveQuery Triggers. - Explains behavioral differences vs
afterLiveQueryEvent, including return semantics and operational considerations. - Provides synchronous and async usage examples.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <!-- TODO: set the parse-server version in which beforeLiveQueryEvent is released --> | ||
| *Available only on parse-server cloud code starting X.X.X* |
| <!-- TODO: set the parse-server version in which beforeLiveQueryEvent is released --> | ||
| *Available only on parse-server cloud code starting X.X.X* | ||
|
|
||
| When LiveQuery is enabled for a class, every object change on that class is published to the LiveQuery server, which then evaluates each subscription to determine which clients to notify. For classes with a high write volume this can consume significant network and CPU resources, even for changes that no client is interested in. The `beforeLiveQueryEvent` trigger runs on the Parse Server instance, once per object write, *before* the change is published, and lets you prevent the publish entirely. |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Documents the new
beforeLiveQueryEventCloud Code trigger.beforeLiveQueryEventsection under LiveQuery Triggers in_includes/cloudcode/cloud-code.md, placed beforeafterLiveQueryEvent.falseprevents the publish. This complementsafterLiveQueryEvent, which runs on the LiveQuery server per matching subscription.Related
beforeLiveQueryEventtrigger parse-server#9445beforeLiveQueryEventparse-server#9431Note
There is a
TODOplaceholder for the exact parse-server version (X.X.X) in which the trigger ships; it should be set once parse-server#9445 is released.Summary by CodeRabbit
beforeLiveQueryEventtrigger in the LiveQuery Triggers guide.afterLiveQueryEvent, including when publishing is blocked or allowed.