-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: Queries with object field authData.provider.id are incorrectly transformed to _auth_data_provider.id for custom classes
#9932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Queries with object field authData.provider.id are incorrectly transformed to _auth_data_provider.id for custom classes
#9932
Conversation
|
🚀 Thanks for opening this pull request! |
📝 WalkthroughWalkthroughA test has been added to verify authData transformation behavior in MongoDB queries. The implementation is updated to restrict authData field mapping to the _User class only, preventing unintended transformations in other classes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
✅ 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. |
authData are transformed for custom classesauthData.provider.id are incorrectly transformed to _auth_data_provider.id for custom classes
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #9932 +/- ##
=======================================
Coverage 93.07% 93.07%
=======================================
Files 187 187
Lines 15243 15243
Branches 177 177
=======================================
Hits 14187 14187
Misses 1044 1044
Partials 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# [8.5.0-alpha.10](8.5.0-alpha.9...8.5.0-alpha.10) (2025-11-17) ### Bug Fixes * Queries with object field `authData.provider.id` are incorrectly transformed to `_auth_data_provider.id` for custom classes ([#9932](#9932)) ([7b9fa18](7b9fa18))
|
🎉 This change has been released in version 8.5.0-alpha.10 |
Pull Request
Issue
Queries with
authData.provider.idare incorrectly transformed to_auth_data_provider.idfor all classes. This transformation should only occur for the_Userclass, whereauthDatais a special field with internal MongoDB representation. For custom classes,authDatashould be treated as a regular field and remain untransformed.Approach
Changes:
classNamecheck intransformQueryKeyValueto restrictauthDatatransformation to_Userclass onlyauthDataqueries work correctly for both_Userand custom classesAll other MongoDB authData transformations are already class-specific:
This fix at line was the only missing check.
Summary by CodeRabbit
Bug Fixes
Tests