Skip to content

Back button stays on site after loading a shared configuration - #2299

Open
mvanhorn wants to merge 1 commit into
spring-io:mainfrom
mvanhorn:fix/571-share-link-back
Open

mvanhorn wants to merge 1 commit into
spring-io:mainfrom
mvanhorn:fix/571-share-link-back

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 6, 2026

Copy link
Copy Markdown

clearHash now calls history.replaceState with the same arguments, so clearing the hash rewrites the current entry instead of pushing a new one. The useHash test mounts the hook with a share hash and expects replaceState to be called with the pathname and pushState not to be called.

Opening a shared configuration link shows the Configuration Loaded notification, but pressing Back stays on start.spring.io and the notification appears again instead of returning to the previous site. This happens in Safari, Firefox, and Mobile Safari. After the share hash is applied, clearHash removes it with history.pushState(null, null, pathname). That adds another history entry for the same page, so Back returns to the hashed URL and the configuration-loaded path runs again.

Tests for this live in start-client/src/components/utils/__tests__/Hash.js.

Fixes #571

clearHash now calls history.replaceState with the same arguments, so
clearing the hash rewrites the current entry instead of pushing a new
one. The useHash test mounts the hook with a share hash and expects
replaceState to be called with the pathname and pushState not to be
called.

Fixes spring-io#571

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using Back after loading a configuration does not work with Safari

2 participants