Bug description
When a link that updates the URL is clicked, and right after the URL is modified via JavaScript, the URL won't update again when the same link is clicked a second time.
Reproduction project
Code: https://glitch.com/edit/#!/arrow-successful-pillow
Live (necessary to see the URL): https://arrow-successful-pillow.glitch.me
Steps to reproduce the behavior:
- Go to reproduction project linked above (live version)
- click on 'New post' (URL and content updates, expected)
- click on 'Update URL' (URL updates, expected)
- click on 'New post' (URL doesn't update, unexpected)
Expected behavior
The URL should be updated every time 'New post' is clicked.
Browser version
- OS: macOS Monterey
- Browser: Firefox (100.2), Safari (15.4)
Additional context
- We observed this behavior when creating new posts in a text editor that autosaves and updates the URL with JS.
- Using
up-history="true"doesn't change the behavior.up-cachebeing true or false doesn't either. - The behavior was introduced in version 2.0.0, in 1.0.1 the URL updates properly (replace
https://unpkg.com/unpoly/unpoly.jsbyhttps://unpkg.com/unpoly@1.0.1/dist/unpoly.jsin the header to verify). - It only happens when it's the same link clicked twice in a row. For the following combination: link1 > JS URL update > link2 > JS URL update > link1, URLs are changed as expected.