solid-router icon indicating copy to clipboard operation
solid-router copied to clipboard

Router with view transition api duplicates navigation history sometimes.

Open illispi opened this issue 1 year ago • 2 comments

Describe the bug

When you click A, B or C route and then hit back navigation sometimes router navigates back to A even thought it should navigate to /. Its kind of rare behavior, so to repro you have try it multiple times. It happens more frequently on Brave browser than Chrome, so I am not sure what to make of it, maybe its some kind browser issue? Especially since on Brave android, sometimes VT api doesn't even trigger sometimes on back navigation. But my another astrojs site doesn't seem to fail on back navigation with vt api, so i can't be sure.

Your Example Website or App

https://github.com/illispi/SolidRouterVTapiIssue

Steps to Reproduce the Bug or Issue

  1. Click A
  2. Click back navigation
  3. repeat on A, B or C until issue occurs.

Expected behavior

Navigate consistently back to correct route.

Screenshots or Videos

No response

Platform

  • Windows 11
  • Chrome and Brave 129

Additional context

No response

illispi avatar Sep 27 '24 13:09 illispi

Yeah.. I can imagine there are exceptions. The truth is the best way to hook into View Transition APis would be something we exposed from core of Solid itself. The tricky part is we have our own async transition method and ideally you want to sneak the snapshot in after that is done but before we apply the render effects. We don't really expose that window right now. So you are stuck too early or too late in some cases.

ryansolid avatar Oct 10 '24 00:10 ryansolid

Was it a mixed backward and forward operation? Would #533 apply to your case?

dennev avatar Aug 10 '25 02:08 dennev