Skip to content

fix: LiveQuery matcher crashes when a pointer or typed field value is null#10546

Open
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/livequery-null-pointer
Open

fix: LiveQuery matcher crashes when a pointer or typed field value is null#10546
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/livequery-null-pointer

Conversation

@dblythy

@dblythy dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member

Closes #7929

Summary by CodeRabbit

  • Bug Fixes
    • Fixed query matching for fields explicitly set to null.
    • Cleared pointer fields no longer incorrectly match equalTo constraints.
    • Prevented errors when comparing null values in queries.
    • Added regression coverage for null pointer and non-pointer fields.

@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

LiveQuery equality handling now safely processes null values. Pointer constraints reject cleared pointers, the shared equality helper avoids null dereferences, and regression tests cover pointer and typed fields.

Changes

LiveQuery null equality

Layer / File(s) Summary
Null-safe equality handling
src/LiveQuery/equalObjects.js, src/LiveQuery/QueryTools.js
equalObjects handles null inputs explicitly, while pointer equality rejects null values before reading pointer properties.
Null equality regression coverage
spec/QueryTools.spec.js
Adds matchesQuery tests confirming null pointer and typed field values do not match equalTo constraints or throw errors.

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


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Description check ❌ Error The description only says Closes #7929`` and misses the required Issue, Approach, and Tasks sections. Add the template sections with a brief issue summary, the approach taken, and the task checklist entries.
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required fix: prefix and accurately describes the null-handling crash fix.
Linked Issues check ✅ Passed The changes address #7929 by guarding pointer matching against null and adding regression tests for null values.
Out of Scope Changes check ✅ Passed The edits stay within LiveQuery null-handling and test coverage; nothing clearly unrelated was introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed Patch only adds null guards in LiveQuery matching and regression tests; no new security-sensitive behavior or vuln patterns introduced.
Engage In Review Feedback ✅ Passed No substantive review feedback is evidenced; only automated review-trigger comments are mentioned, so there’s nothing ignored or prematurely resolved.
✨ 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.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.66%. Comparing base (cce91e5) to head (952db2a).
⚠️ Report is 52 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10546   +/-   ##
=======================================
  Coverage   92.66%   92.66%           
=======================================
  Files         193      193           
  Lines       16981    16983    +2     
  Branches      248      248           
=======================================
+ Hits        15736    15738    +2     
  Misses       1224     1224           
  Partials       21       21           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dblythy

dblythy commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

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.

LiveQuery pointer comparison does not handle null

1 participant