plausible / plausible-tracker

Frontend library to interact with Plausible Analytics
https://github.com/plausible/plausible-tracker
MIT License
214 stars 46 forks source link

When loading a deep url while not being logged in (anymore) website hangs, rather than showing 404 #67

Closed corneliusroemer closed 2 months ago

corneliusroemer commented 2 months ago

Versions

Version used on plausible.com on the 12th of July 2024. But this bug has been around for a while, I just never bothered reporting it.

Describe the bug

When I load a deep URL to my website's dashboard, e.g. https://plausible.io/foo.org (if my website was foo.org) and I haven't been on plausible in a while (refreshing my auth token), the website get stuck in some "pretending to load" state forever, rather than showing a 404 or redirecting to login page.

This is resolved by reloading the page, upon which I'm shown the correct 404 with button to login.

Expected behavior

When I load a deep URL, I either get to see the page, or I get shown 404, but the website shouldn't get stuck showing a "loading" page forever

Steps to reproduce

Might be a bit tricky to reproduce as one needs to wait for a token to expire. But this is essentially what I do:

  1. Log in to plausible
  2. Load my dashboard url, e.g. https://plausible.io/foo.org
  3. Not use plausible for a long time, not sure what the minimum required is to show the bug, it might be as much as a month or more, I rarely check plausible. The time could also be shorter. Hard to tell for me.
  4. Load the dashboard url again https://plausible.io/foo.org
  5. Observe result: a loading page (unfortunately I forgot to screenshot when it happened and due to the difficulty in reproduction I might not be able to for a while)
  6. Reload page
  7. Observe correct result: 404

Your Environment

corneliusroemer commented 2 months ago

Wrong repo, will move to https://github.com/plausible/analytics