feat(pwa): add managed pinned application updates - #169
Draft
Vyachean wants to merge 160 commits into
Draft
Conversation
…ates - implement tests for develop channel isolation, lifecycle management, and migration from legacy workers - ensure independent state management for stable and develop channels - validate automatic and manual update processes, including rollback and offline behavior - cover migration scenarios from legacy Workbox workers to managed controllers
Contributor
Preview deployment
This comment is updated automatically on every push to this PR. |
- add state locking mechanism to ensure serialized access to controller state - implement update discovery process for automatic and manual modes - create comprehensive tests for state management and update checks - ensure proper handling of state transitions and error scenarios
- add support for rolled-back update states in the service worker - enhance the update settings UI to reflect rollback scenarios - introduce tests for rollback behavior in both manual and automatic modes - ensure the service worker correctly handles failed installation attempts
…e correctly - update tests to wait for service worker readiness before asserting state - improve reliability of controller state checks during migration scenarios - refactor controller state reading logic for clarity and reuse
- ensure that a discovery during an active activation does not trigger preparation or approval of another release - maintain the integrity of the activation process by recording the discovery without interfering with the ongoing activation - add tests to verify that the latest release is recorded correctly without affecting the activation state
- ensure cleanups are serialized and do not overlap - protect preparations from being affected by concurrent cleanups - update tests to cover new cleanup behavior
- add handling for the latest release to prevent premature deletion - ensure completed releases remain protected until approval is persisted - update tests to cover new scenarios for release protection
- remove the detailed AppUpdateSettingsSection component - add a single action entry for app updates in the settings - update tests to reflect the new app updates navigation and status display
A sole-window reload is a safe application restart and should be indistinguishable from closing the final window and reopening it. FetchEvent.replacesClientId-based reload classification proved unreliable across engines (Chromium/Firefox activate on it, WebKit does not), so activation now depends only on same-channel window liveness. Client identities are still excluded from the window count by id, but no longer used to detect reloads specifically. Adds a cross-engine (Firefox/WebKit) lifecycle spec covering the portable clean-launch contract (uncontrolled/second window blocks, close-and-reopen activates, boot rollback) using one shared browser context and release chain per engine, and a Chromium-only regression covering a second live window blocking a lone navigation's activation. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ioframe/mioframe into feature/managed-pinned-updates
…fications - add timeout to update notification for better user experience - ensure state remains unchanged on same-sequence conflicts - implement automatic preparation target resolution logic - enhance tests for update checks and cancellation behavior
…automatic paths - ensure that only releases newer than the activeRelease can be approved - add tests to verify that activeRelease and older releases are not approved
- add handling for failed releases in manual mode to prevent notifications - ensure automatic mode does not allow approvals or preparations - update tests to cover new behavior for failed releases and mode switching
- update test description to clarify activation starts when no other same-channel window is live - remove unnecessary comments regarding reload behavior
…ce worker - add support for displaying activation status in the App Update settings - ensure activation state is reflected in the UI without false update notifications - enhance service worker message handling to validate requests and manage responses - introduce tests for activation scenarios and protocol request validation
…ransitions - refactor message handling to ensure responses are posted before any follow-up work is executed - improve error handling to return stable failure envelopes without exposing raw exception messages - update UI components to reflect the correct activation status and version during updates - enhance tests to cover new behavior and ensure proper ordering of operations during state changes
…states - ensure the last-resolved value is maintained when the query re-emits transient undefined for active edits - clear the resolved property only when the property ID changes - add tests to verify behavior under transient states
…states - remove outdated tests for useDatabaseProperty - refactor useDatabaseProperty to simplify property resolution logic - update defineCacheObservable to use shareReplay for better caching - adjust databasePropertiesService to prevent unnecessary re-emissions
- throw an error if fallback focus is invoked after the form is unmounted - ensure fallback focus always returns a valid target while the trap is active
- implement classification for BOOT_OK and BOOT_FAILED reports to manage state transitions accurately - ensure rollback paths are triggered correctly when cache operations fail - improve handling of concurrent manual installs to prevent false failures - isolate client delivery failures during broadcasts to ensure all clients receive messages - enhance tests to cover new classifications and error handling scenarios
…rgets - ensure that a non-activation-target response does not settle the watchdog - update tests to reflect the new behavior of not disarming on false activation - verify that late GET_ACTIVATION_STATUS responses do not mutate settled states
…t errors - ensure only one navigation can perform the ready → activating transition - block other navigations with a controlled 503 response - separate transient error feedback from lifecycle status in UI - update tests to cover new behavior and edge cases
…ts run correctly - modify reconciliation logic to handle effects from failed attempts - ensure effects are executed after fallback responses are posted - add tests to verify behavior of ReconciliationFailure handling
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.
Status
Draft — the managed-update core is implemented, and the recovery architecture is now complete in the single canonical document. PR 169 is not implementation-complete until the recovery flow and its required proof are present.
Goal
Add managed pinned application updates for stable (
/) and develop (/branch/develop/) with Automatic and Manual modes, immutable per-release archives, controlled activation, rollback between managed releases, and explicit worker-owned recovery.Canonical architecture
docs/managed-pinned-updates.mdis the single source of truth.Accepted model:
available | ready | activating | failed;releaseNumber,appVersion,buildId,buildDate;skipWaiting()orclients.claim();OperationQueueand one preparation/cleanup-onlyPreparationCoordinator;BOOT_OK;Recovery architecture
The worker must provide a self-contained diagnostic recovery page for:
State-loss recovery:
Known-active recovery:
readycandidate and passes the ordinary clean-launch andBOOT_OKactivation flow;ready/activatingare forbidden.Diagnostics use stable allowlisted categories only. Raw state, exception messages, stack traces, paths, tokens, and user content are forbidden. Recovery commands use the existing 120-second long-operation semantics and remain idempotent under retries and concurrent windows.
Initial Workbox transition
Release 1 and any later state-loss recovery baseline must contain no irreversible user-data migration. If such a baseline cannot finish boot, navigation reconciliation must still be able to discover and activate a corrected newer release.
Remaining before merge
docs/managed-pinned-updates.mdwithout changing valid-state update, activation, publisher, or user-data ownership.verifyis green on the exact final head.Merge
Target:
develop.Method: squash merge after final approval.