jiegillet · GitHub

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:

  1. Go to reproduction project linked above (live version)
  2. click on 'New post' (URL and content updates, expected)
  3. click on 'Update URL' (URL updates, expected)
  4. 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-cache being 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.js by https://unpkg.com/unpoly@1.0.1/dist/unpoly.js in 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.

Read the original on github.com ↗