fix(core,nextjs-router,remix-router): parse deeply nested conditional filters with syncWithLocation#7245
Open
harsha-cpp wants to merge 1 commit intorefinedev:mainfrom
Open
Conversation
… filters from URL Increased qs.parse depth from default 5 to 10 to correctly deserialize deeply nested conditional filters (or -> and -> filter) when using syncWithLocation. Previously, filter properties were incorrectly parsed as bracket notation keys ([field], [operator], [value]) after page reload.
🦋 Changeset detectedLatest commit: d4ea0ef The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
When using
useDataGrid(oruseTable) withsyncWithLocation: trueand deeply nested conditional filters like:After page reload, the filters are incorrectly deserialized from the URL. The nested filter properties become bracket notation keys:
Instead of:
This causes errors like
cannot read properties of undefined (reading 'map').What is the new behavior?
Deeply nested conditional filters are now correctly parsed from the URL after page reload. The
qs.parsedepth has been increased from the default 5 to 10, which supports the nesting depth required by conditional filters (or→and→{field, operator, value}= 7+ levels).Notes for reviewers
The fix is applied to all three packages that use
qs.parsefor table params:@refinedev/core@refinedev/nextjs-router@refinedev/remix-routerA regression test has been added to verify deeply nested conditional filters are correctly round-tripped through stringify/parse.
Fixes #7242