Repository navigation
Keep valid automation history when repairing a damaged profile - #37336
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…story Schema verification no longer reads automation history metadata, so the read-concurrency tests now assert that open succeeds without reading it and that ordinary reads still keep snapshots consistent and refuse corrupt metadata. Add output coverage for the recovery-required message, the startup failure text (English and a translation) and the bundled CLI recovery route printing kept and backup-restored sections.
Review loop statusThe problem. When part of a saved profile was damaged, Orca's section repair could throw away good automation history. If only the history's small placeholder record was damaged, repair treated the whole history as broken and replaced it with the last backup (or emptied it when no backup existed), so every run since that backup disappeared. If the history's own bookkeeping was damaged instead, Orca refused to open the database at all and offered no section repair, only a whole-profile restore. What changes for users.
Review. Full path, one review round (three reviewers), one fix round, repair check agreed.
Verified. CI green on the head. Real running-app QA on the M4Air with a profile the app itself created (real automation runs, a real backup, a setting changed afterwards), damaged by hand, then repaired, compared with main on the same saved profile:
Not verified. The startup Repair dialog itself: test copies run as background launches, where Orca never shows it, so QA started from the exact request its Repair button sends. Its text is covered by dialog tests in English and Japanese. The dialog is a native message box with no app-controlled layout. Since QA. QA ran on For Brennan's review
Damaged history bookkeeping, repaired from the backup, newer setting kept: Where judgment matters:
|



ELI5
Repairing a damaged profile could replace perfectly good recent automation runs with an older backup. If the history's own metadata was damaged instead, Orca could not offer or complete the section repair. This keeps verified current runs when only their bookkeeping is damaged and lets the existing approved backup repair handle damaged history metadata.
What Changed
Why
The history's normalized records are authoritative; its document placeholder is derived bookkeeping. Treating placeholder damage as damage to the history discarded data that Orca had already independently verified. Requiring corrupt destination metadata to pass validation before replacing it also made recovery depend on the fault it needed to remove.
The common pattern reconstructs storage from known current values. This applies that mechanism through the existing complete replacement path rather than adding recovery-specific validation exceptions or another writer.
Linked Issue
Tracked in STA-11671: https://linear.app/stably/issue/STA-11671/profile-section-repair-mishandles-damaged-automation-history-30931
Visual Proof
Same damaged profile (valid history with two runs, damaged history placeholder, an older backup holding only the first run), repaired, then opened:
The startup Repair dialog's new "your current runs will be kept" line is covered by dialog tests in English and Japanese. Test copies run as background launches, where Orca deliberately never shows that dialog, so the running-app checks started from the exact repair request the dialog's Repair button sends.
Testing
Review
Full path. The plan received independent architecture reviews before implementation, and the PR went through the review loop (see the status comment).
Agent skill upstream boundary
Notes
Checklist