Skip to content

fix(extensions): a failed upgrade no longer deletes the working extension (#1562) - #1676

Merged
ZhuchkaTriplesix merged 3 commits into
devfrom
issue/1562-failed-upgrade
Oct 17, 2026
Merged

ZhuchkaTriplesix merged 3 commits into
devfrom
issue/1562-failed-upgrade

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1562.

  • LocalExtensionInstaller.installArchive extracts into a hidden sibling folder, validates there, then swaps (old -> backup, new -> place, delete backup; restore on failure).
  • HttpMarketplaceRepository.install uses the same path, so removed files no longer linger and common-root stripping matches the local installer.
  • The registry skips dot-prefixed folders, so a staging/backup folder left by a crash is never loaded as an extension.
  • Tests: failed upgrade keeps v1; upgrade replaces files instead of mixing versions.

@github-actions github-actions Bot added bug Something isn't working stability Theme parser epic label: stability marketplace Extensions marketplace, ExtensionManifest P2 Medium priority / Parity & Refactoring labels Oct 17, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit d3a7981 into dev Oct 17, 2026
13 checks passed
@ZhuchkaTriplesix

Copy link
Copy Markdown
Member Author

🔍 Post-Merge Code Review & Verification

Significant reliability upgrade for the extension ecosystem:

  1. Atomic Upgrade Pipeline (local_extension_installer.dart):

    • The two-phase extract-to-staging (.installing) and atomic rename swap (.backup -> target) guarantees that broken archives or extraction failures cannot destroy an active, working extension.
    • Crash resilience: leftover .backup directories are automatically recovered or cleaned up on the subsequent installation cycle.
  2. Registry Hygiene (local_extension_registry.dart):

    • Filtering out dot-prefixed directories prevents half-installed or backup artifacts from appearing as ghost extensions in the UI.
  3. Shared Invariant with Marketplace:

    • Routing HttpMarketplaceRepository.install through installArchive eliminates divergent installation code paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working marketplace Extensions marketplace, ExtensionManifest P2 Medium priority / Parity & Refactoring stability Theme parser epic label: stability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant