Separate account status from the account list, and stop stranding accounts

Recomputing statuses reads the Keychain, which cannot know that a server
rejected a credential or failed to answer — and it ran in reaction to
the same notification those verdicts were announced with, so it erased
them as they were recorded. Status changes now have their own
notification. With that separation `unreachable` no longer has to be
preserved to survive: it is transient, and preserving it stopped every
read from reaching the server, so nothing would ever discover that the
network had come back.

A fetch already running when its provider is discarded now has its
result dropped. Signing in again — or switching Apple account — changes
neither the context nor the account ID, so the previous login's channels
would otherwise arrive as the current account's.

Caches with no recorded owner are discarded rather than adopted. The
first launch after upgrading finds feeds written before anyone recorded
whose they were, and the Apple account may have changed since.

The legacy validator's auto-correction moves the data context with it,
and Manage Channels reloads on the context rather than the legacy value
— it could list one account's channels while unsubscribes went to
another.
This commit is contained in:
Arkadiusz Fal
2026-08-27 18:19:29 +02:00
parent cc0fd3e6f4
commit b07af6c153
5 changed files with 83 additions and 14 deletions

View File

@@ -281,7 +281,11 @@ struct ManageChannelsView: View {
await refreshChannels()
}
}
.onChange(of: settingsManager?.subscriptionAccount) { _, _ in
// The data context, not the legacy setting: switching between two
// logins on the same instance leaves that value identical, and this
// view would keep listing one account's channels while unsubscribes
// went to the other.
.onReceive(NotificationCenter.default.publisher(for: .dataContextDidChange)) { _ in
Task {
await refreshChannels()
}