Uninstall manifest can lose recorded paths when two processes call recordOwnedConfigPath
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- sqlite, typescript
- Domain
- tooling
Research direction
Start in src/lib/config-ownership.ts with recordOwnedConfigPath, which appends to a process-cached manifest and rewrites it, and compare it with removeOwnedConfigState, which reloads from disk. Then look at the config mutation lock and INITIAL_OWNED_PATHS to see how cross-process serialization is already done. Done means a test where two cached instances each record a different path and both paths survive in the on-disk manifest for uninstall.
Written by the indexing model from the issue text.
Description
Client or integration
Other
Area
Installation or packaging
Summary
recordOwnedConfigPath in src/lib/config-ownership.ts appends a path to the uninstall manifest from a process-local cached copy of the manifest and then rewrites the whole file. Two processes that share one config home can each hold an older cached manifest, so the later writer replaces the file without the path the earlier writer just recorded, while both calls return true. removeOwnedConfigState reloads the manifest from disk, so the dropped path is not removed by uninstall.
I expected a recorded path to stay in the on-disk manifest until uninstall, whichever process recorded it.
Today this affects every file registered after home creation, including spend-ledger-owner.sqlite (prepareOwnerPath), config-mutation.sqlite for homes created before it joined INITIAL_OWNED_PATHS, and every default atomicWriteFileNoFollow write. Paths listed in INITIAL_OWNED_PATHS are unaffected for homes created after they were added.
Suggested fix: serialize manifest updates across processes (for example under the config mutation lock) and reload the manifest from disk inside that critical section before appending.
Reproduction
- Start from an owned config home whose manifest lacks paths
aandb. - Process 1 and process 2 both load the manifest (it is now cached in each).
- Process 1 calls
recordOwnedConfigPath(home, a); the manifest on disk listsa. - Process 2 calls
recordOwnedConfigPath(home, b); it writes its cached list plusb, soais gone. removeOwnedConfigState(home)leavesabehind.
Version
2.97.0 (dev, commit 6f1d3e65c)
Operating system
All platforms (logic is platform independent).
Provider and model
No response
Logs or error output
No error: both recordOwnedConfigPath calls return true.
Screenshots and supporting files
No response
Redacted configuration
{}
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 16h 51m
- Merged PRs (30d)
- 681
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lidge-jun/opencodex#8101 · 2 comments ·
Maintainers usually reply within 1 day
-
bug install
Difficulty 3/5 1-2 days Newbie friendliness 72/100
lidge-jun/opencodex#8095 · 2 comments ·
Maintainers usually reply within 1 day
-
bug proxy tools
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lidge-jun/opencodex#8089 · 2 comments ·
Maintainers usually reply within 1 day
-
account-pool provider provider-compatibility
Difficulty 4/5 3-5 days Newbie friendliness 22/100
lidge-jun/opencodex#8087 · 1 comment ·
Maintainers usually reply within 1 day
-
account-pool enhancement
Difficulty 4/5 3-5 days Newbie friendliness 30/100
lidge-jun/opencodex#8082 · 1 comment ·
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/playwright#43875 · 1 comment ·
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
calagopus/panel#285 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Under an hour Newbie friendliness 88/100
adobe/react-spectrum#10909 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Run the dependency drift checkPossibly taken @spaceninja claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
cloudfour/lighthouse-parade#449 ·
Maintainers usually reply within 1 day