feat: Add support for `Parse.Query.include` in LiveQuery
Pull Request
- Report security issues confidentially.
- Any contribution is under this license.
- Link this pull request to an issue.
Issue
Add support for Parse.Query.include in LiveQuery. Requires a Parse Server version that also supports this, see https://github.com/parse-community/parse-server/pull/9827.
Approach
Pass include param on to server.
Summary by CodeRabbit
-
New Features
- Added support for handling the
includefield in live query subscriptions, allowing related data to be included in real-time updates.
- Added support for handling the
-
Tests
- Updated tests to verify correct handling of the
includefield in live query subscription payloads.
- Updated tests to verify correct handling of the
🚀 Thanks for opening this pull request!
[!WARNING]
Rate limit exceeded
@mtrezza has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 32 seconds before requesting another review.
⌛ How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the
@coderabbitai reviewcommand as a PR comment. Alternatively, push new commits to this PR.We recommend that you space out your commits to avoid hitting the rate limit.
🚦 How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.
📥 Commits
Reviewing files that changed from the base of the PR and between 9656a666af87ac24cacb8df504a9807e1728a6ff and f950fb13f338279b57b1e027f025e6c7482a33be.
📒 Files selected for processing (2)
src/LiveQueryClient.ts(5 hunks)types/LiveQueryClient.d.ts(1 hunks)
📝 Walkthrough
Walkthrough
Support for the include field in query JSON has been added to the LiveQueryClient class. The include property is now extracted, converted to an array, and included in subscription requests. Corresponding test cases have been updated to construct queries with include and assert its presence in the subscription payloads.
Changes
| File(s) | Change Summary |
|---|---|
| src/LiveQueryClient.ts | Added logic to extract and include the include array from query JSON in subscription requests. |
| src/tests/LiveQueryClient-test.js | Updated tests to use query.include(['key']) and verify include in subscription payloads. |
Sequence Diagram(s)
sequenceDiagram
participant Client as LiveQueryClient
participant Server as LiveQuery Server
Client->>Client: Parse query JSON, extract 'include'
Client->>Server: Send subscription request with query (includes 'include' array)
Server-->>Client: Acknowledge subscription or send data
sequenceDiagram
participant Test as Test Suite
participant Client as LiveQueryClient
participant Server as Mock WebSocket
Test->>Client: Construct ParseQuery with include(['key'])
Client->>Server: Send subscription payload (contains include: ['key'])
Test->>Server: Assert payload includes 'include' field
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.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai auto-generate unit teststo generate unit tests for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
:tada: Snyk checks have passed. No issues have been found so far.
:white_check_mark: security/snyk check is complete. No issues have been found. (View Details)
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
5aa45b1) to head (f950fb1).
Additional details and impacted files
@@ Coverage Diff @@
## alpha #2694 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 63 63
Lines 6185 6187 +2
Branches 1456 1456
=========================================
+ Hits 6185 6187 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.