refactor: extract UpdateCoordinator from App.xaml.cs#604
Conversation
Moves update check, download, install, and dialog logic from App.xaml.cs into a dedicated UpdateCoordinator service. App retains a single _updateCoordinator field and delegates all four call sites (startup, CLI arg, IAppCommands, deep link). XamlRoot is resolved via Func<XamlRoot?> (hub-first, keepalive fallback) so the coordinator has no direct window reference. Fixes a latent bug where UpdateCommandCenterInfo.Detail was mutated in-place on the existing object instead of being replaced — AppState.UpdateInfo only fires PropertyChanged on assignment, so the in-place mutation was silently dropped by the UI. Addresses part of openclaw#554. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 11:10 AM ET / 15:10 UTC. Summary Reproducibility: not applicable. this is a refactor PR rather than a bug report. The attached recording provides after-refactor behavior proof for the startup update-check and remembered-skip path. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused extraction after the in-progress checks complete, preserving the existing updater semantics and keeping the whole-object Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor PR rather than a bug report. The attached recording provides after-refactor behavior proof for the startup update-check and remembered-skip path. Is this the best way to solve the issue? Yes: extracting one cohesive update coordinator is a narrow maintainability step, and the AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against eb06fba21c44. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
App.xaml.cshad grown to over 4000 lines with update check, download, install, and dialog coordination mixed in alongside unrelated concerns. This moves the entire update flow into a dedicatedUpdateCoordinatorservice.What changed
Services/UpdateCoordinator.cs— holds the three concurrency fields, six methods, and all update-related logicApp.xaml.cs— adds a single_updateCoordinatorfield, wires it up during startup, and delegates all four call sites (startup check, CLI arg,IAppCommands, deep link handler)Func<XamlRoot?>(hub window first, keep-alive fallback), so the coordinator has no direct reference to any windowUpdateCommandCenterInfo.Detailwas mutated in-place on the existing object;AppState.UpdateInfoonly firesPropertyChangedon assignment, so the mutation was silently dropped by the UITesting
./build.ps1dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restoredotnet test ./tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restoredotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restoreProof
Manual run after the
UpdateCoordinatorextraction. The log shows the update flow firing through the new coordinator on startup:Checking for updates...Update available: v0.5.0Skipping update prompt for remembered version v0.5.0Behavior preserved: the check runs, the version is detected, and the remembered-version skip is honored — identical to the pre-refactor path.
pr604-update-flow.mp4
Notes
No behavior change is intended. The update dialog, skip logic, concurrency model, and
#if DEBUGpaths are preserved exactly. Addresses part of #554.Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com