mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
Refuse to repair a context that is not this identity's
Foreground activation repairs a selection whose account this device knows was deleted. The check for whether that is safe was the identity scope being resolved, which it already is in the window between an Apple account change moving the namespace and the reload refilling memory — so the repair weighed the previous identity's selection against the previous identity's tombstones and announced the result to a user who had not been shown an account yet. Fenced on the loaded namespace, the same way saves are. Three smaller things around the same theme: - The destination rows forgot their membership answers on a credential or account change but not on an instance change, which adds a row to the picker while it is open. Unknown reads as unsubscribed, so that row offered to subscribe a channel the account already has. - The subscriptions settings count applied whatever the fetch returned. A selection change is fenced by the service's provider generation, but the fallback to local is driven by availability and announces nothing, so the context is captured before the fetch and rechecked after it. - Deleting a source from the browser runs the same cascade as deleting it from Settings, and was the one dialog left that did not say the logins go with it.
This commit is contained in:
@@ -353,14 +353,23 @@ struct SubscriptionsSettingsView: View {
|
||||
}
|
||||
|
||||
/// Refreshes the account-scoped subscription count shown in the export footer.
|
||||
///
|
||||
/// The context the fetch was started for is rechecked before its answer is
|
||||
/// applied. A selection change would already have been fenced by the
|
||||
/// service's provider generation, but the fallback to local is driven by the
|
||||
/// account's availability and announces nothing — so a count still in flight
|
||||
/// would otherwise land under the local heading it never came from.
|
||||
private func refreshAccountSubscriptionCount() async {
|
||||
guard let subscriptionService else { return }
|
||||
|
||||
if let cached = subscriptionService.cachedSubscriptionCount {
|
||||
accountSubscriptionCount = cached
|
||||
}
|
||||
if !effectiveContext.isLocal {
|
||||
|
||||
let context = effectiveContext
|
||||
if !context.isLocal {
|
||||
if let channels = try? await subscriptionService.fetchSubscriptions() {
|
||||
guard effectiveContext == context else { return }
|
||||
accountSubscriptionCount = channels.count
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user