parse-server
parse-server copied to clipboard
fix: Queries fail on nested date attributes
New Pull Request Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am creating this PR in reference to an issue.
Issue Description
Queries return empty results if nested date attributes are used in constraints
Related issue: #7575
Approach
MongoDB transformer was implemented to only transform root level attributes and leave nested attributes as it is except Date and Bytes. There was inconsistency between transformQueryKeyValue and parseObjectToMongoObjectForCreate which was causing some nested date queries to fail. following changes are made to fix it.
- Don't transform nested
Datetypes - Don't transform query constraints, where key is a path, like
rootProp.nestedProp.
TODOs before merging
- [x] Add test cases
- [x] Add entry to changelog
Thanks for opening this pull request!
- 🎉 We are excited about your hands-on contribution!
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
679c61d) 94.13% compared to head (572dabf) 84.86%. Report is 289 commits behind head on alpha.
:exclamation: Current head 572dabf differs from pull request most recent head 433de1a. Consider uploading reports for the commit 433de1a to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## alpha #7582 +/- ##
==========================================
- Coverage 94.13% 84.86% -9.28%
==========================================
Files 182 183 +1
Lines 13785 13624 -161
==========================================
- Hits 12977 11562 -1415
- Misses 808 2062 +1254
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I will reformat the title to use the proper commit message syntax.
Could you look at the failing postgres tests? I seems the postgres adapter needs some changes too? And could you delete the TODOs at the top that don't apply here?
I'm not very familiar with PostgreSQL. I'll take a dig at it and see if I can figure it out.
Do you need a hand with Postgres?
Sorry for the delay. I'm busy with some company work now. I'll take a look as soon as I can
I've gone through PostgresStorageAdapter. Based on what I understood, iso of date type is being used in queries, so it should work but it's not. Maybe I'm missing something.
Help would be appreciated as I'm not familiar with Postgres
I will reformat the title to use the proper commit message syntax.