This repository was archived by the owner on Feb 26, 2025. It is now read-only.
4641 // Pin history version to fix issue with opening ids with encoded characters #1478
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.
Fixes #4641
Description
This is meant to be a temporary solution until we update react-router to v6 (where the following issue is fixed with some caveats).
If a resource id has some encoded chars (like - https://hello.lol/https%3A%2F%2Fencoded.url%2Fwow),
history.push
pushes this to window.location:instead of:
Using an older version of
history
and forcing all fusion dependencies to use this version is working for now.I tried pinning version
4.7
of history but that didn't work.This solution is taken from remix-run/history#505 (comment)
Thanks to @bilalesi for sharing the solution
How to test this PR
Run
yarn
to install the older version ofhistory
With fusion using dev version of nexus, try going to http://localhost:8000/copies/sscx/resources/https%3A%2F%2Fdev.nise.bbp.epfl.ch%2Fnexus%2Fv1%2Fresources%2Fcopies%2Fsscx%2F_%2F1bd3d9a5-7533-4033-b575-1823862c7b8c This should work
If you search for the above resource in MyData or Data-Explorer or project listing views and click on its row, then it should open the resource container with the right resource instead of showing an error.
Types of changes
Checklist: