sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
6.99k stars 433 forks source link

Following a prefetched link will fail if switching quickly back and forth #1667

Closed ehrencrona closed 3 years ago

ehrencrona commented 3 years ago

Describe the bug If, starting from a page A you click on a link to a page B and then - before B loads - hovering over a preloading link to A, then you will not be able to follow the link to A once B finishes loading. The URL will update, but the previous page will remain active.

To Reproduce In https://github.com/ehrencrona/sapper-prefetch-caching-repro is the Sapper template but with a preload for the home page and for the blog page that takes 2 s to execute.

Go to /blog and reload. Then in quick succession click home, blog and home again. Wait two seconds. Now click blog. The URL will update but you will still be on the home page.

Expected behavior I expect the blog to render.

Severity Moderate; occurs on real public sites when preloading is slow.