mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 21:22:53 +00:00
Round two of review on the accounts layer. The settings picker mapped its legacy instance-keyed selection straight onto DataContext(legacy:), which turns an instance UUID into an account UUID. That identity only holds for migrated accounts - a login created after the revamp has a random ID - so selecting a freshly added account named one that does not exist and left the provider nil. Selections now resolve through AccountsManager to an actual account on that instance, preferring a signed-in one. The picker still lists one entry per instance and so cannot show a second login; the Phase 3 switcher replaces it. BackgroundFeedRefresher was missed in the previous sweep because it resolves credentials differently: it routed on the legacy setting and looked up "first enabled Invidious instance" with an instance-keyed credential. After any new-style login that silently found nothing and skipped the refresh. It now routes on the selected context and takes the credential from that account. Subscription reads used the raw stored context, so an account waiting on its instance or credential rendered empty instead of falling back to local data as the tri-state design specifies. Reads go through the validator's effective context; writes deliberately do not, so a subscribe fails visibly rather than landing in local data the user did not choose. Account statuses are cleared when the identity namespace reloads, but nothing recomputed them once a deferred scope resolution succeeded - a synced account kept showing "sign in required" until relaunch. The scope change now triggers a refresh, deferred by one turn so it cannot depend on observer registration order relative to the store's own reload.