Skip to content

fix(updates): keep peer rows stable and recheck the local app - #373

Merged
nixuuu merged 1 commit into
devfrom
fix/update-center-peer-rows
Nov 8, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/update-center-peer-rows

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 8, 2026

Copy link
Copy Markdown
Member

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.
  • Focused peer-cache regression coverage plus linked update/control and timeout integration checks, one test file at a time. Includes completion waiting, throttling, older desktops, non-admin owner checks, and rejection of an unlinked owner.
  • Browser review on an isolated port: light/dark, desktop/phone widths, short/typical/long names, downloaded/error/offline states and check timestamps. No UI test suites added.
  • EAS CLI 27.4.1 production fingerprint generation before/after for both platforms: iOS 2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3, Android c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d; unchanged. Mobile edits are JS/TS only. No native builds or publication.

Copy audit (docs/copy.md §8):

  • Missing freshness information → Checked {time} / Check time unavailable; short sentence-case labels distinguish app checks from gateway polling.
  • Browser omission → Canopy on this computer; uses the existing product and computer terms. Local update guidance uses the existing compact information control.
  • No new errors, confirmations, jargon, repeated facts, or humor. Existing action names remain verbs. Checked labels and long names at desktop and phone widths; meaning remains visible without color or icon shape.

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

Keep successful peer snapshots fresh during background refreshes. Route manual checks through the owning desktop control channel, coalesce repeated requests, and expose actual app check timestamps with an older-client fallback.

Fixes: #348

Related: #369, #370, #371
@nixuuu
nixuuu merged commit 45a5503 into dev Nov 8, 2026
10 checks passed
@nixuuu
nixuuu deleted the fix/update-center-peer-rows branch November 8, 2026 21:54
nixuuu added a commit that referenced this pull request Nov 10, 2026
Share check promises, bound updater work, recover stale attempts on wake, and preserve staged updates. Report persisted overlap through the live updater state.

Related: #70

Related: #373, #459
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant