776afcacea
Suppress the export-only repair for a legacy session.html with no recorded evidence, narrow the identity check to the web's own, and keep the stricter partial rule for an unverified complete status. Fix the analyzer findings, add gating/legacy/Cupertino coverage, format, and correct the parity docs.
3.7 KiB
3.7 KiB
Visit Session export-only repair
Delivered
The Timeline visit pane's Session section offers the web client's export-only session repair for that exact visit:
- Control —
Retry export onlyin a nativeTextButton(Material) orCupertinoButton(Cupertino);Exporting…while the request is pending. Disabled while the visit/run is active or a request is pending, so one choice sends one request. - Request —
RunsRepository.repairSessionExportsendsrepair_session_exportwith exactlyrun_idand the visit's recordedexport_sequenceand requiresrun_detailin the reply, matchingweb/src/repository.jsand the Go protocol. No choice id is invented: the visit's own recorded sequence is the choice. - Reply — the accepted run detail is folded through
RunsController.acceptRunDetail, so the pane re-reads the recorded repair/export facts. Nothing is mutated optimistically. - Refusal — the server's reason is shown verbatim beside the unchanged recorded state; the control remains available and no success word appears.
- Scope of state — in-flight/refusal state is per
run:sequence; changing visits clears it and a late reply for another visit is ignored.
Availability rule (recorded decision)
The web inserts the control in two places of auditSession
(web/src/views/runDetail.js:361-388): when there is no openable artifact at
all, and when recorded evidence exists with a non-complete status or a
truncated document. The app now mirrors that:
- no document at all plus the web's identity (
step.session_idorstep.session_export.session_id) and a positive sequence → offered; - present document → offered only when
visitSessionExportNeedsRepair(export)is true (truncated, or a recorded status that is not verified complete); - a legacy
session.htmlselected only by the no-evidence fallback → not offered, matching the web (nothing to compare, and the server's ownership join would likely refuse it).
Deliberate difference from the web, preserved: this client treats a recorded
complete status without the server's positive messages/html_bytes,
untruncated and diagnostic-free evidence as partial, so that document keeps
the control. The app does not widen identity to an id read only from repair
evidence; the web does not either.
Review fixes (visit 2)
- Suppressed the control for the legacy no-evidence
session.htmland added Material/Cupertino regression coverage. - Fixed the two analyzer findings:
?repair,null-aware element and a private test helper. dart formatapplied to the changed files.- Updated
PARITY.mdandnotes/R4-session-export.md, which still said the command was unwired. - Added coverage for active/
waitinggating, complete-export suppression, visit-change state clearing, the Cupertino control and "no other request".
Known nonblocking gaps
- In-flight state is widget-local: leaving the Session section and returning
before the reply allows a second tap. The web keeps a page-level
run:seqpending set. The normal live path still converges through the server'ssession_export_updatedevent and the scheduledget_run. - A reply completing after the pane unmounts is dropped; the same server event re-reads the run.
- Artifact matching is by name only, ignoring
size_bytes == html_bytesand repair session/backend/directory filters (documented innotes/R4-session-export.md). Inherited. - Full per-visit repair choices remain unwired.
Verification
flutter analyze— No issues found.flutter test test/features/runs— 212 passed.flutter test— 1335 passed.flutter build web— built.- No browser interaction/capture, Android/iOS build or device check was run. Mobile remains unverified.