Skip to content

onboarding: offer a report when sign-in fails; neutral failure read-out - #161

Merged
GLinnik21 merged 1 commit into
mainfrom
onboarding-report
Sep 19, 2026
Merged

GLinnik21 merged 1 commit into
mainfrom
onboarding-report

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Part 1 of 3 of the onboarding-report work (#75/#76 blind spot on main): a sign-in that fails is no longer invisible, and nothing is sent without the person's approval.

What changes

  • Incidents. Every sign-in failure raises a closed-schema incident (auth/owner/incident.rs), owned by the session machine and rendered by the login screen.
  • Permission, not a policy bump. report_permission(scope) + Errors scope 7. POLICY_VERSION stays 4, so a No stays No.
    • Not determined → alert Send a report about this sign-in problem? Not now / Send report (one-off, no persistent id).
    • Granted at scope 7 → standing report sent automatically (a stalled QR wait never auto-sends).
    • Declined → nothing kept; only a user-pressed Details → Send report.
  • One-off lane (telemetry/oneoff.rs, Category::OneOff) with a delivery watch, so the status line is truthful: sending → saved → sent / couldn't be sent.
  • Failure read-out. Neutral verdict (no red), reason in a two-line slot, [Try again] [Details]. Details opens a card (Report ID, support line, Close / Send report); the QR screen uses the same card.
  • One placement for page-filling failure read-outs (sign-in, Home, Library section) and one wording ("Can’t reach your Plex server", "Try again").
  • PRIVACY.md, the in-app policy and the consent preview describe the new report; a test pins incident keys against PRIVACY.md.

Later PRs: 2 = save/keymanager, stored-session locked, profile switch; 3 = content seam (onboard libraries, first Home).

Verification

  • make check, cargo +nightly check --lib --no-default-features, make (ARM) — all green on the committed tree.
  • Simulator + dev Sentry: 6/6 scenarios (unset / yes-at-4 / yes-at-7 / no × error / stall); one-off events carry no user id, the standing one carries the errors id; nothing sent under No.
  • Simulator captures of every read-out state reviewed. Not yet verified on the TV.

🤖 Generated with Claude Code

Sign-in failures now raise closed-schema incidents, and a person can send
a one-off report about one without granting standing error reporting.

- Incident state machine (auth/owner/incident.rs): every sign-in ending
  names its own incident (worker failures carry their evidence; endings
  inside the app raise IncidentKind::Internal; an ending the report does
  not cover retires the held offer). A 401/403 from /resources is
  Authorization, and Try again after it starts a new QR sign-in instead
  of re-presenting the refused token. A stalled QR wait is offered behind
  Details only (OnRequest), never as an alert over the code.
- Consent gains report_permission(scope) -> NotDetermined/Granted/Declined
  and Errors scope 7 (ONBOARDING_REPORT_SCOPE). POLICY_VERSION stays 4, so
  a stored No stays No, and a Yes given before scope 7 is offered per
  incident rather than granted.
- telemetry::incident is the closed onboarding-failure schema (IncidentKind,
  LinkClass from net's request evidence with the curl code, bucketed
  counters, persistence failure class). telemetry::oneoff is the bounded
  one-off lane (queue::Category::OneOff: allowed under any consent, exempt
  from purge_withdrawn, erased on sign-out and Delete all local data).
  telemetry::delivery watches a Report ID from the moment its lane takes
  it until a server accepts or drops it.
- When permission is not determined the login screen asks once per offer
  (Not now / Send report DecisionAlert); when granted at scope 7 a standing
  report goes automatically and shows its Report ID; otherwise Details ->
  Send report sends a one-off.
- Report status is truthful: Sending (inline spinner) -> Saved (spooled,
  will send when the connection is back) -> Sent (a 2xx) | Failed
  (re-sendable), fenced by event id and receipt.
- Details opens a DecisionAlert card (open_card) with the grouped Report
  ID, the support line, [Close] and [Send report] while it can be sent;
  the QR screen's Details uses the same card.
- A failed StatusOverlay follows the design system: verdict bold at TITLE
  in TEXT_SECONDARY, reason in a reserved two-line slot, no warning
  colour, busy note and secondary pills. Page-filling read-outs (sign-in
  failure, Home's failed hubs, a failed Library section) use .page() and
  one placement from FULL_ANCHOR_TOP; bounded read-outs keep centring.
  One wording: "Can’t reach your Plex server" and "Try again".
- PRIVACY.md, the consent preview, CRASH_BODY and the in-app policy
  describe the report, the internal kinds and the standing Report ID; a
  test pins every sign-in incident key against PRIVACY.md.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 19, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@GLinnik21
GLinnik21 merged commit 5fbd974 into main Sep 19, 2026
5 checks passed
@GLinnik21
GLinnik21 deleted the onboarding-report branch September 19, 2026 15:57
GLinnik21 added a commit that referenced this pull request Sep 19, 2026
#161's sign-in offer alert and Details card drew as empty glass on the
television while the simulator drew them fully: the simulator runs with the
frame cache off, so the cached host path was never exercised there.

Cause: popover::host promotes a captured page snapshot to a ground snapshot
without marking the ground as drawn this frame, so a later host::live() scope
(the dispatcher's empty modal-scrim scope after Login's embedded alert)
replayed the foreground-free ground over the alert's title, body and buttons.
A successful capture now sets GROUND_DRAWN. The regression test drives the real
host state machine over a CPU FrameCache stand-in and was red before the fix.

Also from the review of #161, each written test-first:
- spool::append_watched_if registers a report's delivery watch under the spool
  lock before the write, so the flush or compaction cannot settle a record
  nobody is watching yet (submit and queue_standing both use it).
- DecisionAlert::reconcile_card keeps an open Details card in step with its
  incident: a receipt arriving while open, or Send report returning after a
  failed delivery, updates in place without restarting the entrance or stealing
  focus.
- ui-sim, which-tier and agent-reference now say the simulator cannot see the
  cached modal ground.

Verified on the television (debug flavour, sign-in failure scenario): both
cards complete at settle and at +10 s, focus moves correctly. Not exercised:
pressing Send report.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.

2 participants