mirror of
https://github.com/yattee/yattee.git
synced 2026-11-05 03:17:19 +00:00
Stop the legacy validator from overruling a local selection
Local data is always a valid context. The legacy validator predates that: it treats local as unavailable without a Yattee Server, which is a feed concern the feed reports itself — and since the correction now moves the data context with it, that would have quietly put users on somebody's backend account, overwriting a local choice made on another device. Stale feed responses no longer touch anything. Rejecting only the videos still let a request from a login the cache had moved off overwrite the new one's loading state, error state and pagination — replacement requests are allowed to overlap, so both were in flight. The unreachable retry timers are cancelled when the namespace reloads. A migrated account reuses its instance's UUID, so the same ID can exist under the next Apple account, and an old timer would declare that account reachable on the strength of a verdict about someone else's. Rewriting a credential's sync flag is skipped when it already matches and restores the original if the re-add fails. Changing that flag means delete-then-add, and the delete propagates to every device — turning sync on should never be able to log the user out.
This commit is contained in:
@@ -127,6 +127,19 @@ final class SubscriptionAccountValidator {
|
||||
return
|
||||
}
|
||||
|
||||
// Local is always a valid context. This validator predates that: it
|
||||
// treats local as unavailable unless a Yattee Server is configured,
|
||||
// which is a *feed* concern — the feed says so itself — not a reason to
|
||||
// move the user onto somebody's backend account, or to overwrite a
|
||||
// local choice synced from another device.
|
||||
if accountsManager?.currentContext.isLocal == true {
|
||||
LoggingService.shared.debug(
|
||||
"Leaving the local selection alone — local data is always available",
|
||||
category: .general
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// A selection whose account still exists is never corrected here. This
|
||||
// validator predates account-scoped credentials and reads "not signed
|
||||
// in" as "not available", which is now routinely temporary — an
|
||||
|
||||
Reference in New Issue
Block a user