oficina / docs Public

Settings: a server account's Accounts… is not guarded; say why an unreadable outbox is skipped

Human

Prompt

Fable re-reviewed d143194..808018e: APPROVE. [...] (3) DocsOficinaViews.swift:203 — the .disabled(block != nil) belongs only on the Oficina ID "Change team…" button; server accounts' "Accounts…" in Settings must not be newly disabled; (2) add a comment at DocsOfflineAccount.swift:363 that an unreadable outbox is skipped deliberately (store stays on disk and resumes when the same identity signs in again).

From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.

Summary

Fable's re-review (APPROVE): the leave guard disables only the Oficina ID Change team… and the sign-out buttons, not a server account's Accounts…; DocsOfflineAccount.hasUnsent documents that an outbox it cannot read is skipped on purpose (kept on disk, resumes when the same identity signs in again).
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 61e06d0303ea36036407e1bd56e7217dcbd5b8f8 parent a6bc64b
2 files changed, +6 −1
  • native/apple/Sources/DocsKit/DocsOfflineAccount.swift +4 −0
  • native/apple/Sources/DocsKit/DocsOficinaViews.swift +2 −1

CI passed — run details

diff --git a/native/apple/Sources/DocsKit/DocsOfflineAccount.swift b/native/apple/Sources/DocsKit/DocsOfflineAccount.swift
index a7c17a9..f796354 100644
--- a/native/apple/Sources/DocsKit/DocsOfflineAccount.swift
+++ b/native/apple/Sources/DocsKit/DocsOfflineAccount.swift
@@ -56,6 +56,10 @@ struct DocsOfflineMetadata: Codable {
let names = (try? FileManager.default.contentsOfDirectory(atPath: root.path)) ?? []
for name in names.sorted() where DocsOficinaSession.account(name, belongsTo: identity) && accounts[name] == nil {
let outbox = Outbox(store: NativeSealedStore(root: root.appendingPathComponent(name), accountID: name, keys: keys(name)), account: name)
+ // An outbox that can't be read (its key unavailable, the device
+ // locked) is skipped on purpose: it is not deleted, its store stays
+ // on disk, and it resumes sending when the same identity signs in
+ // again. Refusing sign-out over it would lock the person in.
guard (try? await outbox.load()) != nil else { continue }
if await !outbox.summary.isEmpty { return true }
}
diff --git a/native/apple/Sources/DocsKit/DocsOficinaViews.swift b/native/apple/Sources/DocsKit/DocsOficinaViews.swift
index 54bf95e..65daa9d 100644
--- a/native/apple/Sources/DocsKit/DocsOficinaViews.swift
+++ b/native/apple/Sources/DocsKit/DocsOficinaViews.swift
@@ -200,8 +200,9 @@ public struct DocsSettingsView: View {
Text("native.settings.server", bundle: DocsResources.bundle)
}
HStack {
+ // Not guarded: a server account's list switches nothing
+ // by itself, and the home window guards what it does.
Button { manage() } label: { Text("native.settings.accounts", bundle: DocsResources.bundle) }
- .disabled(block != nil)
Spacer()
Button(role: .destructive) { signOut() } label: { Text("docs.signout.label", bundle: DocsResources.bundle) }
.disabled(block != nil)