Repository navigation
Show "Claudiu is already running" instead of starting a second app on one data folder - #118
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… one data folder Two Claudiu apps on the same data folder raced each other: both rewrote state.json, and whichever polled first took a session's request files, so an attach_github call made in one app could vanish in the other. Startup now takes a lock on `claudiu.lock` in the data folder. A second app that can't get it within 5 seconds shows a small window saying Claudiu is already running, then quits when it is closed. The wait covers an update or restart, where the new app starts while the old one is still closing. A debug build still runs beside the installed app, since it has its own data folder. Closes #84
m4rocks
force-pushed
the
one-app-per-data-folder
branch
from
November 17, 2026 10:13
a14d975 to
0c4831a
Compare
This branch was successfully deployed
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.
Summary
Two Claudiu apps on the same data folder raced each other. Both rewrote
state.json, and whichever polled first took a session's request files, so anattach_githubcall made in one app could vanish in the other.Startup now takes an OS file lock on
claudiu.lockin the data folder, held until the app exits. A second app that can't get it within 5 seconds shows a small "Claudiu is already running" window and quits when it is closed. The wait covers an update or restart, where the new app starts while the old one is still closing. A debug build still runs beside the installed app, since it has its own data folder.Evidence
a_second_app_cannot_take_a_data_folder_until_the_first_lets_go: a second lock on the same folder fails, another folder is free, and the folder is free again once the first lock is dropped.cargo test: 495 passed, 0 failed.Screenshot of the notice (not attached, since
ghcan't upload images): "Claudiu is already running / Another Claudiu window uses the same data folder. Switch to it instead. [OK]".Not checked: macOS and Linux, and a real Velopack update restart.
Risk
If an update's new app starts more than 5 seconds before the old one exits, it shows the notice instead of opening, and opening Claudiu again fixes it. If the lock can't be taken at all, for example on a read-only disk, startup goes on as before. Revert this commit to undo it.
Closes #84