fix: Parse.Query.select('authData') for _User class doesn't return auth data#10055
fix: Parse.Query.select('authData') for _User class doesn't return auth data#10055mtrezza merged 4 commits intoparse-community:alphafrom
Parse.Query.select('authData') for _User class doesn't return auth data#10055Conversation
|
🚀 Thanks for opening this pull request! |
📝 WalkthroughWalkthroughAdds a test ensuring Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant REST as REST Layer (RestQuery)
participant Auth as Auth Adapter Registry (getProviders)
participant DB as Database
Client->>REST: Request _User fields=authData (useMasterKey)
REST->>Auth: getProviders()
Auth-->>REST: ["facebook", ...]
REST->>DB: find(query, projection: authData + _auth_data_facebook, ...)
DB-->>REST: user record (includes _auth_data_facebook)
REST-->>Client: user object with authData populated
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/Adapters/Auth/index.js`:
- Around line 264-270: The catch block in the filter over allProviders uses an
unused exception binding `e`; update the try/catch in the function that returns
[...allProviders].filter(...) (the block that calls loadAuthAdapter(provider,
authOptions)) to remove the unused binding by changing `catch (e)` to an empty
catch `catch {}` (and keep returning false inside it) so the linter no longer
complains about an unused variable while preserving the current behavior.
🧹 Nitpick comments (1)
src/Adapters/Auth/index.js (1)
257-271: Consider caching or memoizing the provider list.
getProviders()callsloadAuthAdapter()for every configured provider on each invocation. InRestQuery.runFind, this is called for every_Userquery that selectsauthData. Since the set of configured providers doesn't change at runtime (barring server reconfiguration), computing this repeatedly is wasteful. A simple lazy-cached value (invalidated on config change) would avoid redundant adapter loading.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## alpha #10055 +/- ##
=======================================
Coverage 92.57% 92.57%
=======================================
Files 191 191
Lines 15589 15603 +14
Branches 176 176
=======================================
+ Hits 14432 14445 +13
- Misses 1145 1146 +1
Partials 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# [9.3.0-alpha.5](9.3.0-alpha.4...9.3.0-alpha.5) (2026-02-12) ### Bug Fixes * `Parse.Query.select('authData')` for `_User` class doesn't return auth data ([#10055](#10055)) ([44a5bb1](44a5bb1))
|
🎉 This change has been released in version 9.3.0-alpha.5 |
Pull Request
Issue
Parse.Query.select('authData')for_Userclass doesn't return auth data. The reason is that theauthDatafield is synthesized and actually stored as_auth_data_<PROVIDER>in the_Userobj. So settingauthDataas selected key for MongoDB won't find a field of such name.Summary by CodeRabbit
New Features
Tests