Skip to content

fix(services): reuse the winning project on concurrent home creation - #115

Merged
DimoADE merged 2 commits into
DimoADE:masterfrom
ArthurKing0629:fix/concurrent-home-project-052
Nov 22, 2026
Merged

DimoADE merged 2 commits into
DimoADE:masterfrom
ArthurKing0629:fix/concurrent-home-project-052

Conversation

@ArthurKing0629

Copy link
Copy Markdown
Contributor

Fixes #110.

Two project snapshot requests can both miss the initial root-path lookup. If another request creates the folder before the insert, recover its project using the existing reuse path. Recovery is limited to folder-only imports, a unique constraint error and an existing matching path. No schema or data migration is required.

Exercises two simultaneous ensure_home_project calls in the existing test. Replayed the missed-lookups/duplicate-insert ordering in a separate SQLite database using the repository's partial unique index: the insert produced code 2067 and re-reading the path returned the original id, with one row remaining. The Rust test was not run locally because Cargo is unavailable. Targeted command: cargo test -p services --test project_tree ensure_home_project_is_idempotent_non_git_folder.

@DimoADE
DimoADE merged commit 7766972 into DimoADE:master Nov 22, 2026
23 of 24 checks passed
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.

[System] Database UNIQUE constraint fails on projects.root_path on startup

2 participants