Archived
Three things, found while chasing two intermittent failures that turned out
to be the test harness tapping the app.
`ensureLabelKey` put the request label back with
`defer { Task { await api.setLabel(previous) } }`, which reads like a
restore and is not one: the task is detached, so the label goes back at
some later moment of the runtime's choosing. Until then every request
carries the wrong area, and when it lands it can undo a label some other
call has since set. Android and the browser both restore synchronously in
a `finally` — only this port drifted. The label is now not moved at all:
storing a grant carries its own label for that one request, so anything in
flight alongside it still goes out under the area the caller is in.
`currentLabelKey` threw `notCleared` — "You aren't cleared for this" — when
the truth was that this device has not minted a key for the area yet, which
is every account before its first write. In a system built on clearance,
telling a properly cleared newcomer they are not cleared is both wrong and
alarming. It now says what is true and what to do about it.
A folder whose name will not decrypt is now checked the same way a file is.
Opening one navigated into somebody else's folder and then complained about
a missing key, which is a confusing way to say "this is not yours" — and
the file branch has always checked.
Also translates CryptoKit's authentication failures, which reached people
as "(CryptoKit.CryptoKitError error 3.)".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>