fix: preserve query params on public link redirect#2199
Merged
JammingBen merged 2 commits intomainfrom Mar 23, 2026
Merged
Conversation
… link resolution Vue Router's resolve() silently drops query params when they are embedded in the path string passed to router.push(). This caused any custom query params (e.g. scrollTo) in the redirectUrl to be lost during public link resolution. The fix splits the URL into separate path and query parts before pushing, so Vue Router receives the query params explicitly. An alternative approach of patching patchCleanPath to recover dropped query params was considered, but deemed too intrusive for now since it would affect all routes with patchCleanPath enabled.
replaceInvalidFileRoute was creating fresh route options via createFileRouteOptions, dropping all existing query params like scrollTo and contextRouteName. Merge the current route's query into the replacement so extension apps can pass custom query params that survive the route correction.
dschmidt
added a commit
to dschmidt/opencloud-web-extensions
that referenced
this pull request
Mar 22, 2026
Replace window.location.search workaround with proper useRouteQuery now that web-pkg's replaceInvalidFileRoute preserves query params (opencloud-eu/web#2199). The scrollTo e2e test is skipped until that fix is released.
dschmidt
added a commit
to dschmidt/opencloud-web-extensions
that referenced
this pull request
Mar 22, 2026
…here - Include folder fileId in anchor URLs so AppWrapper's replaceInvalidFileRoute preserves scrollTo query param - Show anchor links on public link views too (fall back to current URL) - Add e2e test that opens a public link with scrollTo and verifies the target file is visible (skipped until opencloud-eu/web#2199)
JammingBen
approved these changes
Mar 23, 2026
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.
Summary
resolve()silently drops query params when they are embedded in thepathstring passed torouter.push(). InresolvePublicLink, theredirectUrlis pushed as{ path: url }where the URL contains query params (e.g.?scrollTo=foo.txt), causing them to be lost after the redirect.parsePathQuery()helper in the router helpers that splits a URL string into separatepathandqueryfields before pushing, so Vue Router receives query params explicitly.patchCleanPathto recover dropped query params was considered, but deemed too intrusive for now since it would affect all routes withpatchCleanPathenabled.Required to make scrollTo work in opencloud-eu/web-extensions#268 :)
Test plan
?scrollTo=foo.txt)