Skip to content

fix: Parse.Query explain runs afterFind on query plan results#10536

Open
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/afterfind-explain
Open

fix: Parse.Query explain runs afterFind on query plan results#10536
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/afterfind-explain

Conversation

@dblythy

@dblythy dblythy commented Jul 4, 2026

Copy link
Copy Markdown
Member

Closes #10007

Summary by CodeRabbit

  • Bug Fixes
    • Explain queries now correctly skip afterFind triggers while still returning query execution details.
    • Added coverage to ensure explain responses continue to include execution statistics and do not invoke the trigger.

@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 4, 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: 51fa27be-c759-43e9-af2f-89059a180c1f

📥 Commits

Reviewing files that changed from the base of the PR and between 7e9d53a and a8f72c4.

📒 Files selected for processing (2)
  • spec/ParseQuery.spec.js
  • src/RestQuery.js

📝 Walkthrough

Walkthrough

The runAfterFindTrigger skip condition in RestQuery.js now also excludes explain queries, preventing afterFind from running on explain results. A new mongo-only test verifies explain queries return executionStats while skipping the afterFind trigger.

Changes

Explain Query afterFind Fix

Layer / File(s) Summary
Skip afterFind trigger for explain queries
src/RestQuery.js, spec/ParseQuery.spec.js
The runAfterFindTrigger early-return condition now also skips afterFind for explain queries (in addition to pipeline and distinct), and a new test confirms explain results include executionStats while the afterFind trigger does not run.

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

Possibly related PRs

Suggested reviewers: Moumouls

🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only says Closes #10007 and omits the required Issue, Approach, and Tasks sections. Add the required template sections: Issue, Approach, and Tasks, and mark completed checklist items relevant to this change.
Engage In Review Feedback ❓ Inconclusive No review-comment/discussion artifacts are present in the repo; only code changes are visible, so engagement with feedback can’t be verified. Provide PR review comments or discussion metadata showing feedback was addressed or retracted before this check can be judged.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the fix and clearly describes the explain/afterFind bug.
Linked Issues check ✅ Passed The code skips afterFind for explain queries and adds a test, satisfying issue #10007.
Out of Scope Changes check ✅ Passed The changes are focused on the explain/afterFind bug and its test coverage, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed Explain is still master-key gated; the patch only skips afterFind for explain results, with no new auth-bypass or injection pattern.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
spec/ParseQuery.spec.js

ast-grep timed out on this file


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

@codecov

codecov Bot commented Jul 4, 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 (a8f72c4).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10536   +/-   ##
=======================================
  Coverage   92.66%   92.66%           
=======================================
  Files         193      193           
  Lines       16981    16981           
  Branches      248      248           
=======================================
  Hits        15736    15736           
  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 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@dblythy

dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 5, 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.

Parse.Query.explain breaks Parse.Cloud.afterFind

1 participant