Skip to content

Comments: recheck the account after a startup failure; never sign from a stale one - #97

Merged
callumalpass merged 1 commit into
mainfrom
fix/identity-abort-91
Nov 13, 2026
Merged

callumalpass merged 1 commit into
mainfrom
fix/identity-abort-91

Conversation

@callumalpass

Copy link
Copy Markdown
Contributor

Refs #91 (production retest of #93 on c73d1cc0acc5, part B failed 6/6 loads)

Cause

  • On SDK beta.188 the hosted SDK worker sends /identity under the collection control's lifetime. collection-control.js passes the control's options.signal to authority.request, and there is no per-request cancel. So an /identity fetch marked aborted means that collection control was closed mid-read, for example when the connection was replaced during startup. The client then gets unauthenticated with reason people_fenced.
  • That same single-request slot is shared with the SDK's launch people-readiness check (identity then members). A second read while it is held fails as unavailable with reason people_busy.
  • Writer (Comments: no false load error after a write; steady signing notice #93) retried only unavailable, once, after 250 ms. It then cached the failed result. The notice stayed until Check again, and createComment took me from that cached failure, so comments were saved unsigned.

Fix (Writer)

  • Transient people-directory failures (unavailable, unauthenticated, cancelled, rate_limited) are checked again after 250 ms, 1 s and 3 s. Refusals and unknown failures are still final.
  • A failed check is never reused: the next panel reload, or a new comment about to be signed, checks again.

Tests

  • A first read cut off (people_fenced), then a busy slot, then success gives a linked account.
  • A refusal is not retried.
  • After a failed check, a new comment is still signed by the linked person. This would fail on Comments: no false load error after a write; steady signing notice #93's code, which cached the failure.
  • pnpm check passes (i18n, typecheck, 371 app tests, 51 core tests).

Not in this PR

What closes the collection control at startup, which aborts the first fetch, lies in the SDK host's connection lifecycle. I couldn't pin the trigger without a live run, and this change doesn't depend on it. No persisted format or public API change.

…m a stale one

On SDK beta.188 a linked account showed "Your comments are not signed ...
could not be checked" on every fresh load, and comments written before
Check again were saved unsigned.

The SDK host makes the /identity READ under its collection control's
lifetime (there is no per-request cancel), so an aborted fetch means the
connection that sent it was closed mid-READ; the client then reports
`unauthenticated`/`people_fenced`. The same one READ slot is shared with
the SDK's launch people readiness, which reports `unavailable`/`people_busy`.
Writer retried only `unavailable`, once after 250 ms, then cached the failed
result: the panel kept the notice and createComment signed from that cached
failure, so the comment went out unsigned.

Writer now rechecks transient failures (unavailable, unauthenticated,
cancelled, rate_limited) after 250 ms, 1 s and 3 s, and never reuses a failed
check, so the next panel reload or new comment checks again. Refusals and
unknown failures are still the answer.

Refs #91
@callumalpass
callumalpass merged commit e14bec0 into main Nov 13, 2026
1 of 2 checks passed
@callumalpass
callumalpass deleted the fix/identity-abort-91 branch November 13, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant