Skip to content

fix(desktop): take the downloads lock when it frees, and use a running server's own token - #555

Merged
linroid merged 1 commit into
mainfrom
fix/desktop-instance-lock-review
Oct 14, 2026
Merged

linroid merged 1 commit into
mainfrom
fix/desktop-instance-lock-review

Conversation

@linroid

@linroid linroid commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Follow-up to #448, from its review.

  • Downloads lock: DownloadsLock.claim now tries the lock again while it waits for the holder to describe itself. ketch server takes instance.lock, then quits without writing instance.json when it finds the app running. An app opened at the same moment used to give up after 3 s with an unknown holder, leaving no engine on the downloads until it was reopened.
  • Stand-in token: a saved device at the address of the ketch server standing in for the app's engine now connects with the token and scheme from instance.json, and saves them at once. It used to connect with the ones saved before, which the server may no longer accept.

Tests: claim_whileACommandQuitsWithoutDescribingItself_takesTheLock, and standIn_atASavedDevicesAddress_isThatDeviceWithTheTokenItUsesNow checks the client's token and the saved one. ./gradlew :app:shared:jvmTest --tests '*InstanceManager*' :app:desktop:test --tests '*DownloadsLockTest*' passes.

…g server's own token

Follow-up to #448, from its review:
- DownloadsLock.claim tries the lock again while it waits for the holder to
  describe itself. A `ketch server` started together with the app can take the
  lock, then quit on finding the app running; the app used to give up after
  three seconds with an unknown holder, leaving no engine on the downloads until
  it was reopened.
- A saved device at the address of the `ketch server` that stands in for the
  app's engine connects with the token and scheme from instance.json, which it
  then saves, instead of the ones saved before, which the server may no longer
  accept.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T03:50:26.520922Z 5fff190 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 14, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@linroid
linroid merged commit 52130d5 into main Oct 14, 2026
12 checks passed
@linroid
linroid deleted the fix/desktop-instance-lock-review branch October 14, 2026 03:51
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