Avoid encoding query parts unnecessarily - #873
Draft
SeanDuHare wants to merge 3 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the intermediate SearchParams encode/decode flow when switching queries, so query changes dispatch state-updating actions directly (avoiding loss of non-URL-serializable values like local provenance File objects).
Changes:
- Removed the
DECODE_FILE_EXPLORER_URL/decodeSearchParamsaction and its redux-logic handler. - Updated
changeQueryLogicto apply a selected query’s parts by dispatching the underlying state actions directly. - Updated selection logic tests to cover the new
changeQueryLogicbehavior and removed the old decode-search-params test.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/core/state/selection/test/logics.test.ts | Removes decodeSearchParams test coverage and adds new tests for direct changeQueryLogic behavior. |
| packages/core/state/selection/logics.ts | Removes decode-search-params logic and rewires changeQueryLogic to dispatch state actions directly. |
| packages/core/state/selection/actions.ts | Removes the now-unused decode URL action/constant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| parts.fileView && dispatch(setFileView(parts.fileView) as AnyAction); | ||
| dispatch(setOpenFileFolders(parts.openFolders)); | ||
| dispatch(setSortColumn(parts.sortColumn)); | ||
| dispatch(toggleNullValueGroups(parts.showNoValueGroups) as AnyAction); |
| dispatch(setQueries(updatedQueries)); | ||
| dispatch(changeDataSources(parts.sources)); | ||
| dispatch(setAnnotationHierarchy(parts.hierarchy)); | ||
| parts.columns && dispatch(setColumns(parts.columns)); |
| dispatch(setAnnotationHierarchy(parts.hierarchy)); | ||
| parts.columns && dispatch(setColumns(parts.columns)); | ||
| dispatch(setFileFilters(parts.filters)); | ||
| parts.fileView && dispatch(setFileView(parts.fileView) as AnyAction); |
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.
Context
Supplying a local provenance file isn't working right now. This is because the path the file takes to make it into the
processProvenancelogic requires getting encoded and decoded. However, since file buffers can't be encoded into query arguments it gets dropped and then we end up with this error:Changes
This removes the unnecessary encode/decode step and has
changeQuerydirectly dispatch the actions.Testing
Tried supplying a local and cloud provenance file. Works first time, able to re-enter provenance which works as well.