atomicdata-dev/atomic-data-browser

Navigate to home not always working correctly

Closed this issue · 1 comments

I've noticed a bug in production a few times that I haven't been able to reproduce in development for some time. Sometimes when navigating to the root (the homepage) of a server, the wrong page shows up.

  • The address bars (both of the browser and atomic-data-browser) show the correct URL
  • The ResourcePage shows the wrong resource, mostly one that was visible a few clicks ago

E.g. here we've visited Home, but we still see the Document Edit invite, which was visited a couple of clicks before:

Screenshot 2022-09-16 at 15 13 22

I think it was this line in the routes:

      <Route path='/' element={<ResourcePage subject={removeTrailingSlash(window.location.href)} />} />

This was called whenever AppRoutes was rerendered. And that is not the right time!