Repository navigation
fix(updates): keep peer rows stable and recheck the local app - #373
Merged
Merged
Conversation
nixuuu
added a commit
that referenced
this pull request
Nov 10, 2026
A remote app-update request could reach a desktop that was already checking or downloading automatically. `checkRemote()` rejected that overlap, and `RemoteAppUpdate` persisted it as a failed installation. Preparation, metadata checks and downloads also had no controller deadlines, so an unresolved request after sleep could retain the running lock indefinitely. The overlap guard originates in #70; #373's check-only command calls `check()`, so it did not introduce that guard. Without logs from the affected Mac, whether its operation was still progressing or hung cannot be distinguished. Manual and remote checks now share the current operation and its actual checking/downloading progress. Channel changes queue behind it and retain downgrade confirmation. Preparation and metadata checks have 60-second deadlines; downloads have a 30-minute total limit and a 90-second stall limit based on increasing transferred bytes. Cancellation propagates to release-feed requests and downloads. Recovery replaces the updater and isolates its download directory, ignoring retired events and late responses. Previously staged updates retain their installable updater. On macOS, module-level commit tokens track the shared native feed: ordinary installs call Squirrel synchronously without replaying `task.done`. Only a displaced feed is replayed, serialized behind any pending finalizer. Local ZIP replay has no controller deadline and propagates actual staging failures through installation error handling; a failed replay remains eligible for retry. Suspend pauses the automatic timer. Resume/unlock recovery is debounced for 5 seconds, restarts stale work through the original shared promise, and restores the schedule. If a timeout finishes before the wake handler, automatic checks retry once; Never suppresses that automatic retry. A persisted busy-only failure reports the live updater phase, while real installation failures remain Failed. Gateway mapping and protobuf contracts are unchanged, including the frozen update service. Updated the Polish operational docs. Validation: - `bun install`, `bun run gen:check`, `bun run typecheck`, `bun run lint`, `bun run format:check`, and `bun run --filter @canopy/web build` passed for the initial change. After the native-feed revision, focused desktop tests, full typecheck, lint and format:check passed again, with a final focused desktop typecheck after the replay-retry refinement. - 29 focused desktop tests passed: 12 controller/remote-coordinator regressions, 13 existing updater/feed/staging tests, and 4 native-feed tests using fakes. Coverage includes joining during checks/downloads, hung prepare/metadata, stale resume, stalled and total download deadlines, repeated progress, error cleanup, queued channels, retained staged updates, Never, and persisted busy versus genuine failures. The native-feed tests verify synchronous installation without re-staging, replay after another commit, serialization behind an unfinished replacement, and real failure propagation followed by a safe retry. - No web UI tests, E2E, or full local `check:tmp` run. CI remains the full-suite gate. Signed macOS sleep/resume and installation were not exercised on this Linux machine; native-feed ownership and replay are covered with fakes, while actual Squirrel staging remains unverified on a real Mac. The web build completed with chunk-size warnings. Copy audit (`docs/copy.md` §8): - Busy-only `Wait for the current app update operation to finish, then retry.` → existing live checking/downloading/ready statuses. Overlap requires no user action and is no longer presented as a failure. - Unbounded wait → `Update timed out. Check the connection, then retry.` Two short sentences identify the event and next action; no protocol names or internal jargon. - Existing action names, genuine failure messages, confirmations, and status layouts remain in use. No new terms, repeated facts, humor, or color-only meaning. No UI templates changed; name-length/responsive/browser review was not run for this controller-only change. Related: #70 Related: #373, #459
nixuuu
added a commit
that referenced
this pull request
Nov 11, 2026
A phone paired to a desktop gateway can see its linked computers' update
actions, but cannot update its own paired computer. Remote web clients
have the same gap.
Expose the home desktop app as an update target and send confirmed owner
UI requests through the existing LocalAppControl → RemoteAppUpdate path.
Keep the installer, durable journal/receipts, idle barrier, Windows
silent install and planned-departure/reconnect handling. The UI shows
real updater progress and refusal reasons. Older gateways/desktops show
a one-time manual-update instruction.
Home app installation requires explicit restart confirmation, lists
known running turns and checks unsent-work blockers before dispatch.
Update all continues to exclude the home app. Standalone gateway and
worker updaters keep their existing actions. Phone credentials cannot
open or report on the desktop control channel. Changes are additive in
canopy.ui.v1; canopy.update.v1 is untouched.
Validation:
- Paired-app gRPC integration: 7 passing tests / 55 assertions,
including owner refusal, confirmation, old/disconnected/disabled
desktop, rate limits/admin failures, receipts, idle barrier, gateway
replacement and recovery using the same paired token.
- Existing linked-updates (10), desktop-updates (8), gateway-departures
(3) and updates-bundled (2) tests pass, one file at a time.
- bun install, gen:check, typecheck, lint, format:check and web build
pass.
- Full check:tmp: passed once, sequentially: 2367 pass, 165 skip, 0 fail
across 440 files (29325 assertions); “nothing left in the temp dir”.
- Manual web fixture review in light/dark at 390, 768 and 1440 px: home
action, progress, older-desktop instructions, running turns, Cancel
focus, long names and blockers. The blocker was also checked again after
opening confirmation.
- EAS CLI 27.4.1 production fingerprints match on both platforms: iOS
6ddec9ef559ee0095ac33e94ff9418a942053b17; Android
5f6eae3ab278f1cd543e9ed763f923a319b65ec9. Mobile changes are JS/TS only.
- Native mobile visual QA is unverified: local device platforms are
unavailable, and the remote device host still reported “Could not
communicate with device support” after its suggested refresh. No native
install or Windows GUI installer was exercised; those paths are reused
unchanged.
Copy audit (§8):
- Before: the home app row had no usable update action. After: named
computer + “Update Canopy on {name}”; the confirmation repeats “Update”
and explains restart, automatic reconnection and the idle barrier.
- Before: the own app needed an update from its computer without a clear
route. After: “Update this computer from its own window once to enable
remote updates.” The dependency and next action stay visible.
- “Send or discard your drafts and files before updating this computer.”
gives a concrete action. Existing failure details remain expandable. New
text uses the glossary, sentence case, present tense, typographic quotes
and correct plurals; no new jargon, empty states or decorative copy.
- Reviewed typical/short and long names on desktop and phone widths.
Actions have accessible text labels; statuses and blocker explanations
do not depend on color. Native layout remains the visual-verification
gap above.
Related: #373
Related: #471
Related: #479
Related: #507
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background refreshes changed a successful peer snapshot from fresh to stale and back on every poll. The waiting message became a transient disclosure on mobile and a changing status line on web. Keep the cached snapshot fresh during refreshes; failed reads still expose stale status and retain details.
Manual checks from mobile and web now reach the desktop app that owns the gateway through the existing app-control channel. Linked checks use the same path at their home. Requests coalesce, have a 10-second cooldown, and wait up to 30 seconds for a newer completed check report. Older desktops receive the existing check command without waiting for unsupported fields. Owner checks remain enforced; checking the app does not grant permission to replace gateway binaries.
Canopy rows show the app's actual check time, including the phone's OTA check time. Older apps show
Check time unavailable. Browser clients of a desktop gateway also show its local app row.Validation:
bun install,bun run gen:check,bun run typecheck,bun run lint,bun run format:check,bun run check:tmp, and the web build.2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3, Androidc5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d; unchanged. Mobile edits are JS/TS only. No native builds or publication.Copy audit (
docs/copy.md§8):Checked {time}/Check time unavailable; short sentence-case labels distinguish app checks from gateway polling.Canopy on this computer; uses the existing product and computer terms. Local update guidance uses the existing compact information control.The stale/fresh flip originates in #348; #369–#371 expose or share the affected data. The local manual-check omission predates them. Release publishing scripts/workflows and the frozen update protocol are unchanged. Signed macOS installation/restart remains outside this check-only verification.
Fixes: #348
Related: #369, #370, #371