dcramer / peated

https://peated.com
Apache License 2.0
50 stars 10 forks source link

Isomorphic loader breaks when context changes #143

Open dcramer opened 2 months ago

dcramer commented 2 months ago

Because the root loader, like all loaders, are executed in parallel, we have once again hit an issue.

  1. Login happens
  2. Server redirects, new server passes the LoadContext into root loader (aka the new user object)
  3. In parallel, we've redirected to /settings
  4. /settings hits window.REMIX_CONTEXT, which is bound in root.tsx, it hasnt bound user yet
  5. /settings then redirects back to /login

No idea how we're going to fix this (sigh) without a hard refresh on login.

dcramer commented 2 months ago

Duct taped in e3d1b73

dcramer commented 2 months ago

Core behavior is solved by using redirectDocument, though it doesnt fix the underlying issue. This could still get hit if the frontend was active and the session expired.