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 |
# [8.5.0](8.4.0...8.5.0) (2025-12-01) ### Bug Fixes * `GridFSBucketAdapter` throws when using some Parse Server specific options in MongoDB database options ([#9915](#9915)) ([d3d4003](d3d4003)) * Deprecation warning logged at server launch for nested Parse Server option even if option is explicitly set ([#9934](#9934)) ([c22cb0a](c22cb0a)) * Parse Server option `rateLimit.zone` does not use default value `ip` ([#9941](#9941)) ([12beb8f](12beb8f)) * Queries with object field `authData.provider.id` are incorrectly transformed to `_auth_data_provider.id` for custom classes ([#9932](#9932)) ([7b9fa18](7b9fa18)) * Race condition can cause multiple Apollo server initializations under load ([#9929](#9929)) ([7d5e9fc](7d5e9fc)) * Server internal error details leaking in error messages returned to clients ([#9937](#9937)) ([50edb5a](50edb5a)) ### Features * Add `beforePasswordResetRequest` hook ([#9906](#9906)) ([94cee5b](94cee5b)) * Add MongoDB client event logging via database option `logClientEvents` ([#9914](#9914)) ([b760733](b760733)) * Add Parse Server option `allowPublicExplain` to allow `Parse.Query.explain` without master key ([#9890](#9890)) ([4456b02](4456b02)) * Add Parse Server option `enableSanitizedErrorResponse` to remove detailed error messages from responses sent to clients ([#9944](#9944)) ([4752197](4752197)) * Add support for MongoDB driver options `serverSelectionTimeoutMS`, `maxIdleTimeMS`, `heartbeatFrequencyMS` ([#9910](#9910)) ([1b661e9](1b661e9)) * Add support for more MongoDB driver options ([#9911](#9911)) ([cff451e](cff451e)) * Allow option `publicServerURL` to be set dynamically as asynchronous function ([#9803](#9803)) ([460a65c](460a65c)) * Upgrade to parse 7.1.1 ([#9954](#9954)) ([fa57d69](fa57d69)) * Upgrade to parse 7.1.2 ([#9955](#9955)) ([5c644a5](5c644a5)) ### Performance Improvements * `Parse.Query.include` now fetches pointers at same level in parallel ([#9861](#9861)) ([dafea21](dafea21)) * Remove unused dependencies ([#9943](#9943)) ([d4c6de0](d4c6de0)) * Upgrade MongoDB driver to 6.20.0 ([#9887](#9887)) ([3c9af48](3c9af48))
|
🎉 This change has been released in version 8.5.0 |
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