Skip to content

fix: Queries for a user fail when the user has authData for an unconfigured auth provider#10549

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

fix: Queries for a user fail when the user has authData for an unconfigured auth provider#10549
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/twitter-authdata-afterfind-crash

Conversation

@dblythy

@dblythy dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member

Closes #9885

If a _User carries authData for an auth provider that isn't configured on the server (e.g. legacy Twitter authData after Twitter keys were removed), every query touching that user returned a 500. runAfterFind called getValidatorForProvider -> validateOptions with no guard, so the throw rejected the whole Promise.all. The sibling getProviders already wraps the same call in try/catch - applied the same guard so an unconfigured provider is skipped (logged at verbose) instead of breaking the read.

Summary by CodeRabbit

  • Bug Fixes
    • Improved backward compatibility when retrieving users with legacy authentication data.
    • User retrieval now succeeds even if an associated authentication provider is no longer configured correctly.
    • Added diagnostic logging when legacy authentication data is skipped due to provider configuration issues.

@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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4099c441-c4e2-47e3-840f-cd4c7f0f28c7

📥 Commits

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

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

📝 Walkthrough

Walkthrough

The authentication adapter after-find hook now tolerates provider configuration errors, logs skipped legacy authData processing, and allows user reads to continue. A regression test covers fetching a user after its provider becomes misconfigured.

Changes

Legacy authData reads

Layer / File(s) Summary
Guard provider validation during afterFind
src/Adapters/Auth/index.js, spec/AuthenticationAdaptersV2.spec.js
runAfterFind catches errors from provider validation, logs a verbose skip message, and continues processing. A test verifies that a user with legacy provider authData remains fetchable when the provider becomes misconfigured.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant UserQuery
  participant runAfterFind
  participant ProviderValidator
  participant Logger
  UserQuery->>runAfterFind: Fetch user with legacy authData
  runAfterFind->>ProviderValidator: Validate provider configuration
  ProviderValidator-->>runAfterFind: Throw configuration error
  runAfterFind->>Logger: Log skipped provider processing
  runAfterFind-->>UserQuery: Return user successfully
Loading
🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required fix: prefix and accurately summarizes the authData query failure fix.
Description check ✅ Passed The description includes the required Issue and Approach sections and links the issue, with only the task checklist left incomplete.
Linked Issues check ✅ Passed The change matches #9885 by preventing unconfigured auth provider validation from breaking _User reads and adding a regression test.
Out of Scope Changes check ✅ Passed The diff stays focused on the auth adapter fix and its regression test, with no clear unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed Patch only skips misconfigured auth-provider afterFind handling; no new injection, path traversal, SSRF, or prototype-pollution pattern appears.
Engage In Review Feedback ✅ Passed No review feedback comments appear in the PR evidence; the branch directly implements the fix and regression test, so there’s nothing ignored or improperly 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.67%. Comparing base (cce91e5) to head (68998f6).
⚠️ Report is 52 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10549   +/-   ##
=======================================
  Coverage   92.66%   92.67%           
=======================================
  Files         193      193           
  Lines       16981    16985    +4     
  Branches      248      248           
=======================================
+ Hits        15736    15740    +4     
  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.

Dashboard data browser not loading _User if a user with Twitter authdata exists

1 participant