mirror of
https://github.com/yattee/yattee.git
synced 2026-11-03 02:17:19 +00:00
Let a refused host count as unreachable and the switcher own every login
Residual round after the macOS fix verification, five closures:
A connection refusal or a failed DNS lookup arrived as APIError.unknown,
which no classifier reads — so an account pointed at a downed instance
never went unreachable, never fell back to local data, never armed a
retry. New APIError.connectionFailed carries the system's own sentence
and lands as unreachable/offline in AccountsManager, InstancesManager
and the credential probe; a refused host now classifies in seconds
instead of never.
Subscriptions' periodic retry armed only for networkError, while the
local fallback's yatteeServerRequired — shown exactly when the account's
server could not be reached — waited on a status expiry nothing was
watching. FeedLoadState.warrantsPeriodicRetry gates on the context's
unavailability, so that screen heals on its own too, and an account that
genuinely has no Yattee Server still never loops.
The switcher dropped every context of a switched-off source, leaving the
toolbar badge pointing at a menu its own selection had vanished from.
listedContexts keeps the rows with their status in the title ("— Source
switched off"), isSwitchable refuses the pick, and the current context
keeps its checkmark.
The sidebar footer's switcher row overflowed the 140 pt column minimum:
the width floor now sits on the menu itself and ViewThatFits drops the
caption — the part the icon already says — before the account name loses
characters.
The channel menu exposed a raw SF Symbol name as its accessibility
title; the label is now a real Label rendered iconOnly, so the AX bridge
hears "Subscription Options".
This commit is contained in:
@@ -37,6 +37,31 @@ enum FeedLoadState: Equatable {
|
||||
return error
|
||||
}
|
||||
|
||||
/// Whether a feed left in this state should keep asking again on its own.
|
||||
///
|
||||
/// A network failure is its own reason to try again. `yatteeServerRequired`
|
||||
/// usually is not — an account that genuinely needs a Yattee Server goes on
|
||||
/// needing one, and a timer there would never end and never change
|
||||
/// anything. The exception is the local fallback standing in for a server
|
||||
/// that merely could not be reached: the feed is asking for a Yattee Server
|
||||
/// only because reads moved to local data, and they move back the moment
|
||||
/// the server answers again — silently, on a status that expires with
|
||||
/// nothing on this screen watching for it.
|
||||
///
|
||||
/// - Parameter unavailability: why the selected context is not the one
|
||||
/// answering, or `nil` when it is — local data selected by the user is
|
||||
/// never unavailable, so its Yattee Server request is the real answer.
|
||||
func warrantsPeriodicRetry(unavailability: DataContextUnavailability?) -> Bool {
|
||||
switch self {
|
||||
case .error(.networkError):
|
||||
return true
|
||||
case .error(.yatteeServerRequired):
|
||||
return unavailability == .unreachable
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/// Specific error types for feed loading.
|
||||
enum FeedLoadError: Equatable {
|
||||
case yatteeServerRequired
|
||||
|
||||
Reference in New Issue
Block a user