Skip to content

feat: add /users/persisted endpoint, independent of live Jellyfin - #72

Merged
jay739 merged 1 commit into
mainfrom
feat/persisted-users-endpoint-for-jellyfin-outage
Jul 16, 2026
Merged

jay739 merged 1 commit into
mainfrom
feat/persisted-users-endpoint-for-jellyfin-outage

Conversation

@jay739

@jay739 jay739 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

The second time in one night: the admin panel's Users tab is unusable during a Jellyfin outage, even after fixing the underlying panics and 500s (#62-#71). GetUsers/SearchUsers fundamentally need a live Jellyfin connection to list users, since Jellyfin is the user database — there's no way to make those endpoints work without Jellyfin reachable, no matter how the errors are handled.

What can work: app.storage's own persistent badger DB already stores an EmailAddress record (Jellyfin ID, email, label, contact/admin flags) per user, independent of Jellyfin's own availability — it's written once and just sits there. This was previously only used internally (housekeeping cleanup, migrations), with no API route exposing it. Recovering it during tonight's incident required a one-off standalone Go program reading the badger DB file directly, which isn't something to repeat every time.

Change

  • GET /users/persisted: returns every stored EmailAddress record (Jellyfin ID, email, label, contact/admin flags)
  • Same webAuth() auth group as every other /users route, no new permissions surface
  • Trades completeness (no online status, no Jellyfin username, no last-active timestamp — just enough to know who to email) for actually working when Jellyfin is down

Test plan

  • With Jellyfin down, GET /users/persisted returns the stored email list
  • With Jellyfin up, confirm no interaction with existing /users//users/count/etc. routes
  • CI build/test passes

Found live 2026-07-16, the second time in one night: the admin panel's
Users tab is completely unusable during a Jellyfin outage, even after
fixing the underlying panics/500s (#62-#71) -- GetUsers/SearchUsers
fundamentally need a live Jellyfin connection to list users, since
Jellyfin IS the user database. There's no way to make that endpoint
work without Jellyfin reachable.

What CAN work: app.storage's own persistent badger DB already stores
an EmailAddress record (Jellyfin ID, email, label, contact/admin
flags) per user, independent of Jellyfin's own availability. This was
previously only accessible via internal code paths (housekeeping
cleanup, migrations) with no API route exposing it -- recovering it
during tonight's incident required a one-off standalone Go program
reading the badger DB file directly.

Adds GET /users/persisted, returning every stored EmailAddress record.
Trades completeness (no online status, no Jellyfin username, no
last-active -- just enough to know who to email) for actually working
when Jellyfin is down. Same auth group (webAuth) as every other /users
route.
@jay739
jay739 merged commit ae897b1 into main Jul 16, 2026
7 checks passed
@jay739
jay739 deleted the feat/persisted-users-endpoint-for-jellyfin-outage branch July 16, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址