Skip to content

Isolate updater staging retries - #316

Merged
IgorWarzocha merged 1 commit into
devfrom
fix/dev-updater-staging-race
Aug 19, 2026
Merged

Isolate updater staging retries#316
IgorWarzocha merged 1 commit into
devfrom
fix/dev-updater-staging-race

Conversation

@IgorWarzocha

Copy link
Copy Markdown
Owner

Summary

  • give each in-app update attempt a unique staging directory
  • prevent a failed installer cleanup from deleting a waiting retry

Why

The update lock was released before outer cleanup removed the shared .partial directory. A waiting retry could acquire the lock and begin staging while the previous attempt was still recursively deleting that same path. Unique staging directories remove the cross-attempt collision.

Validation

@IgorWarzocha
IgorWarzocha merged commit c9a0a84 into dev Aug 19, 2026
1 check passed
@IgorWarzocha
IgorWarzocha deleted the fix/dev-updater-staging-race branch August 19, 2026 22:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e71e7d4b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (!existingCacheTrusted) {
temporaryPaths.root = path.join(paths.cacheRoot, `.tmp-update-${Date.now()}-${process.pid}`)
temporaryPaths.installDir = `${paths.installDir}.partial`
temporaryPaths.installDir = `${paths.installDir}.partial-${process.pid}-${randomUUID()}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reclaim abandoned per-attempt staging directories

If the process is killed or the machine reboots after extraction begins, this UUID-suffixed directory survives, and the next retry now stages elsewhere instead of removing it as the former fixed .partial path did. pruneOldVersions treats every directory under versions/ as a version and retains the five newest, so even one interrupted attempt can leave an almost-complete app bundle consuming disk indefinitely, while repeated interruptions can also displace real cached versions from the retention set; remove stale matching staging directories or exclude and delete them during pruning.

Useful? React with 👍 / 👎.

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