Skip to content

docs: Add beforeLiveQueryEvent trigger#977

Open
codeKonami wants to merge 2 commits into
parse-community:gh-pagesfrom
codeKonami:add-before-live-query-event-docs
Open

docs: Add beforeLiveQueryEvent trigger#977
codeKonami wants to merge 2 commits into
parse-community:gh-pagesfrom
codeKonami:add-before-live-query-event-docs

Conversation

@codeKonami

@codeKonami codeKonami commented Jul 1, 2026

Copy link
Copy Markdown

Summary

Documents the new beforeLiveQueryEvent Cloud Code trigger.

  • Adds a beforeLiveQueryEvent section under LiveQuery Triggers in _includes/cloudcode/cloud-code.md, placed before afterLiveQueryEvent.
  • The trigger runs on the Parse Server instance (once per object write) before an event is published to the LiveQuery server; returning false prevents the publish. This complements afterLiveQueryEvent, which runs on the LiveQuery server per matching subscription.

Related

Note

There is a TODO placeholder 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

  • Documentation
    • Added a new section describing the beforeLiveQueryEvent trigger in the LiveQuery Triggers guide.
    • Clarified how it works alongside afterLiveQueryEvent, including when publishing is blocked or allowed.
    • Added details on the available request data, synchronous and asynchronous examples, and key runtime/error behaviors.

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>
Copilot AI review requested due to automatic review settings July 1, 2026 20:06
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d92c2385-c437-4c56-9cec-b267aac51a56

📥 Commits

Reviewing files that changed from the base of the PR and between 3d8260a and e1fa4e8.

📒 Files selected for processing (1)
  • _includes/cloudcode/cloud-code.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • _includes/cloudcode/cloud-code.md

📝 Walkthrough

Walkthrough

This PR adds Cloud Code documentation for beforeLiveQueryEvent, including its blocking behavior, request shape, execution timing, error handling, and examples.

Changes

LiveQuery trigger documentation

Layer / File(s) Summary
beforeLiveQueryEvent documentation section
_includes/cloudcode/cloud-code.md
Documents the new trigger’s purpose, the return false publish-blocking rule, its relation to afterLiveQueryEvent, request fields, synchronous completion behavior, and error handling, with sync and async examples.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is relevant, but it uses the unsupported prefix "docs:" instead of the required "doc:". Change the prefix to "doc:" while keeping the rest of the title, e.g. "doc: Add beforeLiveQueryEvent trigger".
Engage In Review Feedback ❓ Inconclusive Shallow repo shows only the final commit; no review-thread or discussion artifacts are available to verify prior engagement or retraction. Provide the PR review thread or discussion metadata showing the feedback was discussed and either implemented in a commit or retracted.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed Docs-only change: no executable code or risky security pattern was added, and the new section adds guidance to avoid mutating request.object.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 beforeLiveQueryEvent section 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.

Comment on lines +852 to +853
<!-- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants