Skip to content

fix: Server crash querying _User after disabling anonymous users#10544

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

fix: Server crash querying _User after disabling anonymous users#10544
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/anonymous-disabled-afterfind-crash

Conversation

@dblythy

@dblythy dblythy commented Jul 4, 2026

Copy link
Copy Markdown
Member

Closes #8681

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a crash that could occur when anonymous user support is turned off after an anonymous account already exists.
    • Queries against user records now return results reliably instead of failing in this edge case.
    • Added coverage for this anonymous-user reconfiguration scenario to help prevent regressions.

@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: baa76606-6884-4a72-9704-1d9598f81fc9

📥 Commits

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

📒 Files selected for processing (2)
  • spec/ParseUser.spec.js
  • src/Adapters/Auth/index.js

📝 Walkthrough

Walkthrough

Fixes a crash when querying _User after enableAnonymousUsers is disabled while anonymous authData still exists on records. getValidatorForProvider now returns undefined instead of { validator: undefined } for the disabled anonymous provider, and a regression test is added.

Changes

Anonymous Auth Validator Fix

Layer / File(s) Summary
Validator return fix and regression test
src/Adapters/Auth/index.js, spec/ParseUser.spec.js
getValidatorForProvider returns undefined instead of { validator: undefined } when anonymous users are disabled, allowing if (!authAdapter) guards to trigger; a new test verifies master-key _User queries no longer crash when anonymous authData exists but anonymous login is disabled.

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

Sequence Diagram(s)

sequenceDiagram
  participant RestQuery
  participant Auth as Adapters/Auth index.js
  RestQuery->>Auth: getValidatorForProvider(anonymous)
  Auth-->>RestQuery: undefined
  RestQuery->>RestQuery: if (!authAdapter) skip runAfterFind
  RestQuery-->>RestQuery: return _User query results
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only says it closes an issue and omits the required Issue, Approach, and Tasks sections. Add the template sections with a brief issue summary, implementation approach, and the relevant task checkboxes.
Engage In Review Feedback ❓ Inconclusive Only the final code commit is visible; no review-thread comments or response history is available to prove feedback was discussed and addressed. Provide the PR review thread or a commit/link showing the feedback comment, the author reply, and the follow-up change/retraction.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the fix and uses the required fix: prefix.
Linked Issues check ✅ Passed The code and test address the crash when querying _User after anonymous users are disabled, matching issue #8681.
Out of Scope Changes check ✅ Passed The changes are limited to the auth adapter fix and a targeted regression test, with no unrelated edits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed PASS: Change only makes anonymous-provider loading return undefined and adds a regression test; no auth bypass, injection, or unsafe pattern found.
✨ 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/ParseUser.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.68%. Comparing base (cce91e5) to head (c84c2c6).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10544      +/-   ##
==========================================
+ Coverage   92.66%   92.68%   +0.01%     
==========================================
  Files         193      193              
  Lines       16981    16981              
  Branches      248      248              
==========================================
+ Hits        15736    15738       +2     
+ Misses       1224     1222       -2     
  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 review

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

Errors after setting enableAnonymousUsers: false

1 participant