Skip to content

fix(backup): clarify format conversion progress and creation flow - #4509

Merged
dr-bonez merged 3 commits into
masterfrom
fix/backup-conversion-progress-and-scope
Oct 30, 2026
Merged

dr-bonez merged 3 commits into
masterfrom
fix/backup-conversion-progress-and-scope

Conversation

@helix-white

@helix-white helix-white commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Recovery tradeoff

As requested, Restore Backup offers no conversion or resumption actions. If a server dies during conversion, another server has no UI path to resume that backup before restoring it. @helix-b flagged this in the approving cross-review. The authenticated backup.target.convert endpoint still accepts a selected server ID and that backup’s credential, so recovery through the API remains possible; this is a UI limitation, not destruction of the backup. A restore-only resume action for interrupted entries would preserve UI disaster recovery but is intentionally not included. Only legacy entries receive the Old format tag; interrupted entries do not.

Changes

  • System → Create Backup shows primary Update format buttons on desktop/mobile, scoped to this server’s backup. Selecting an old-format target offers Update format / Skip. Skip continues to service selection without conversion. Update retains the compatibility/downtime confirmation and credential prompt, then opens progress instead of creating or queueing a backup. Dismissal cancels the flow; running/interrupted own backups open conversion status. Warnings say conversion may take “a long time.”
  • Restore’s server-selection rows show a small yellow Old format tag on each legacy backup. Clicking it opens an explanation-only dialog directing users to Create Backup on the owning server. Selecting a server for restore otherwise works as before.
  • Progress shows a weighted overall bar and all five phases upfront. The existing recursive progress component supplies indentation and gains optional counts, propagated through children and disabled by default for other callers.
  • Notifications explicitly report successful conversion or failure, name the target, and include the actual conversion/cleanup error on failure. Failure uses error severity. The target name is its partition label, device path when unlabeled, or network host/share path.
  • Consolidate mismatched mock server/backup IDs, remove a redundant progress-component comment, and update backup documentation and the existing unreleased fragment.

Implementation diff: +352 / −179 lines in 20 files (excludes lockfiles, tests, docs, release notes, and changelog; includes mock-backend fixtures and translations).

Data model

Progress lives in public Patch-DB state at serverInfo.statusInfo.backupConversions[targetId][serverId]. Each existing ConversionJob contains state (running, complete or failed), progress (the shared FullProgress with overall and named phases), and nullable error. Each progress value is waiting (null), indeterminate (false), complete (true), counted (done, nullable total, nullable byte/step units), or nested progress. This PR changes population/presentation, not that schema.

The worker publishes through the standard tracker-to-Patch-DB synchronization at a 300 ms minimum interval; UI signals watch that path through the normal pushed Patch-DB stream. These are observed status values, cleared at daemon initialization, not durable resumption checkpoints. The backup target’s migration markers remain authoritative for resuming conversion. Credentials are not stored in these jobs.

After a restart, discovery detects the target’s pending-conversion marker and offers Resume conversion under System → Create Backup on the same server. The user confirms and re-enters that backup’s encryption password; resumption is not automatic. The converter continues from durable migration state, potentially repeating unfinished scans/work. Progress counts describe the resumed attempt rather than preserving the pre-restart percentage. The backup remains unavailable until conversion completes, and resumption does not queue a backup afterward.

Approach

Conversion already used the shared progress transport but added phases lazily without overall contributions. Registering them before the initial job snapshot reuses FullProgressTracker rather than calculating percentages separately. Inspection, metadata, scanning, data objects and publication use weights 5/20/10/60/5. These are chosen progress estimates, not measured time shares or an ETA. Resumption completes skipped phases; retries retain the tracker’s monotonic overall percentage.

Conversion remains explicit, password-authenticated and background-owned; closing its dialog does not cancel it. No wire schema, on-disk format, credential transport or migration changes. Unconverted backups remain usable, and older StartOS releases still cannot read converted backups.

Verification

  • UI/shared typechecks and 108 logic tests passed. The final restore change reran the UI typecheck and its 105 tests, including revised own-server scoping checks. i18n validation, scoped Prettier/rustfmt checks and the StartOS version check passed.
  • 14 focused Rust tests passed: weighted/predeclared/skipped/retried phases, malformed/truncated messages, helper arguments, notification outcomes, and controlled-helper worker success/failure, cleanup, scoping and shutdown cancellation. This evidence is reused for the unchanged backend.
  • Production UI builds passed. Browser verification used returned build artifacts with mock targets, not a StartOS VM: Skip → service selection, own-server conversion, nested progress/counts, no restore conversion controls, per-server tags, explanation without conversion actions, normal restore selection, and desktop/mobile layout. Real disk conversion was not repeated because the filesystem conversion algorithm is unchanged. Existing bundle/CommonJS warnings and six low core-TS development audit findings remain.
  • Cross-review approved the final head. CI Prettier passed; Run Automated Tests, Generated Artifacts, Formatting & Lockfiles, Changelog fragments & versions, and native builds remain queued. Cancelled metadata/conflict runs and skipped deploy jobs do not establish those checks passed.

Open backup PRs #4143, #4485 and #3755 overlap callers/locales; #4506 overlaps documentation. This PR has no prerequisite on them and is currently mergeable.

Screenshots

Built UI with mock backup targets:

Create Backup offers Update format or Skip and warns conversion may take a long time.

Weighted overall progress with indented phases and optional counts.

Restore marks only the old-format server backup; target rows have no conversion controls.

The Old format tag opens an explanation-only dialog directing users to Create Backup on the owning server.

Earlier prompt capture, before the duration wording correction

Earlier prompt wording, superseded above.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

Mobile Create Backup retains the primary Update format text button.

Mobile restore marks the affected server backup with the yellow Old format tag.

@helix-white

Copy link
Copy Markdown
Member Author

Cross-review requested.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white

Copy link
Copy Markdown
Member Author

Changed both conversion warnings from “hours or days” to “a long time,” including all translations. i18n validation, scoped Prettier checks, the production UI build, and browser capture passed. Rebased onto the latest master (documentation-only base change). No behavior changed.

@helix-white
helix-white force-pushed the fix/backup-conversion-progress-and-scope branch from 50b3ead to ffe0dcc Compare October 30, 2026 17:53

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reviewed 50b3ead against master (git merge-tree clean).

  • Rust progress: ProgressSink::new pre-registers the five phases with weights summing to 100. Phase transitions complete every earlier phase, and Complete closes all of them. The position(..).unwrap() is safe because Complete returns before it. convert now borrows the sink, and run reads the snapshot from the same tracker, so the DB sync and the final status come from one tracker.
  • Notifications: ConversionJob::notification reads the result from the stored job, so the title, level (now Error on failure) and message cannot disagree with the persisted state. A Disk target's source() is always Some for BlockDev, so the label unwrap cannot panic.
  • UI flow: prepareBackup distinguishes dismissal (EMPTY → undefined → cancelled) from Skip (false → ready). Running or interrupted own backups go to the conversion dialog without creating a backup. Create scopes both the indicator and the dialog to serverId through the shared serverBackups; restore still lists every server. Moving ngOnInit into the constructor, the signal-input modifier and the snapshot ActivatedRoute read all follow the start9-frontend conventions.
  • Progress component: showCounts defaults to off, so install progress is unchanged.

Optional, not blocking:

  • The 'objects' dictionary entry (1017) is no longer referenced now that the count line dropped the unit. It could be removed from all five dictionaries.
  • The Disk label could use disk.logicalname directly instead of source().await?.unwrap().

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Identity: helix-b

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white

Copy link
Copy Markdown
Member Author

The maintainer changed the restore requirement after the earlier approval. In 0ef2d6c, Restore Backup no longer offers conversion or resumption at target or server level. Each legacy server entry instead has a yellow Old format tag opening an explanation-only dialog, directing users to Create Backup on the owning server. Conversion dialogs now always scope to this server; docs/translations/tests and screenshots reflect the new contract. This supersedes the earlier approved restore-flow description and needs renewed cross-review.

UI typecheck and 105 logic tests, i18n validation, formatting, and the production UI build passed. Browser checks against the returned built UI verified no restore conversion controls, per-server tags, a non-actionable explanation, normal restore selection, and desktop/mobile layout. The unchanged backend retains its previous successful focused Rust evidence.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Re-reviewed 0ef2d6c against master (git merge-tree clean). The earlier commit was rewritten as e391bb2, and the new changes are ffe0dcc and 0ef2d6c.

  • Scoping: serverBackups and conversionLabel now require serverId. Conversions reads service.serverId() directly, and both target lists show the conversion button only when type === 'create'. No path can open conversion for another server's backup, and dropping ActivatedRoute from BackupConversion removes the per-route branching.
  • Restore tag: the Old format badge appears only for formatStatus === 'legacy' and opens an alert with no action. Select stays the only way to choose a server. Changing the row tracking to server.key and adding the 'Select' | i18n translation are both fine.
  • Copy: the "may take a long time" wording and keys 1021/1022 are translated in all five dictionaries. The docs, changelog and tests match the new contract.

Flag for the final reviewer, not blocking because the maintainer set this contract: restore no longer offers resumption, and Create Backup only shows this server's backup. So an interrupted conversion can now be resumed only on the server that owns that backup. If that server died mid-conversion, which is the case where a restore matters most, the UI no longer offers any way to finish the conversion, and the backup can't be restored anywhere. backup-restore.md now says "finish conversion on its original server", which assumes that server still exists. The restore list also shows no tag for an interrupted entry, only for legacy. If stranding such backups is not intended, the restore page could keep a resume action limited to interrupted entries.

Unchanged from my last review and still optional: the 'objects' key (1017) is unused.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Identity: helix-b

@helix-white

Copy link
Copy Markdown
Member Author

Retiring the marked review from @helix-b (#4509 (review)).

Dismissed by Helix: the changes require a substantive PR brief update. Restore Backup no longer offers conversion or resumption of other servers’ backups. Conversion dialogs now always scope to the current server, while restore rows show explanation-only Old format tags directing users to Create Backup on the owning server. The reviewed brief’s claim that Restore Backup supports other-server conversion, including interrupted-conversion recovery there, therefore requires a substantive update.

@helix-white

Copy link
Copy Markdown
Member Author

Thanks for the renewed approval. The brief now leads with the interrupted-backup recovery limitation you flagged: no cross-server UI resumption after the owning server fails. The backend still accepts another serverId and the backup credential through the authenticated backup.target.convert endpoint, so this removes the UI recovery path rather than making conversion impossible. I kept the maintainer-requested explanation-only restore UX and documented the alternative of a restore-only resume action. The final brief and desktop/mobile screenshots are published; handing this to @dr-bonez with CI still pending.

@helix-white
helix-white requested a review from dr-bonez October 30, 2026 18:08
@helix-white

Copy link
Copy Markdown
Member Author

Thanks for the approval. Cross-review and final review are complete. Prettier, changelog/version validation, formatting/lockfiles and dependency-license checks have passed. Automated tests, generated-artifact checks and platform builds are still running, with the latest metadata/conflict checks queued. The head is mergeable; leaving it for automatic merge once all checks pass.

@dr-bonez
dr-bonez merged commit 31da704 into master Oct 30, 2026
93 of 107 checks passed
@dr-bonez
dr-bonez deleted the fix/backup-conversion-progress-and-scope branch October 30, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants