🤖 fix: config load drops workspace rows when two project keys normalize to the same path
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start in src/node/config/index.ts at Config.normalizeConfigProjects, where the stripped keys are turned into a Map that keeps only the last pair per normalized path. Reproduce with the two alias cases in the table, /home/u/repo with /home/u/repo/ and C: with C:\, by loading and then saving a real Config. Done when both workspace ids survive the save and the throwOnError id set includes them.
Written by the indexing model from the issue text.
Description
Summary
When config.json stores two project keys that normalize to the same path, the next save drops the workspace rows of all but one of them. Examples: /home/u/repo and /home/u/repo/, or C: and C:\. This happens on every platform.
Cause
Config.normalizeConfigProjects (src/node/config/index.ts) builds new Map(normalizedPairs) from the stripped keys. A Map keeps the last pair for a key, so earlier aliases vanish in memory, and the next save writes only the survivor.
Reproduction (probed on main 424453bd0f, real Config, load then save)
| Stored keys | Saved result |
|---|---|
"/home/u/repo" (ws-one), "/home/u/repo/" (ws-two) |
[["/home/u/repo", ["ws-two"]]] |
"C:" (ws-one), "C:\\" (ws-two) |
[["C:", ["ws-two"]]] |
ws-one is gone from disk in both cases. Strict callers (throwOnError) also get an id set without those rows.
Context
Found while planning #5924. #5924's drive-root key change makes C: and C:\ aliases more likely after a downgrade and an upgrade, so #5924 depends on this fix.
Ownership
- Owner: the coordinator desk.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $113.10
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 140
- Avg merge
- 2h 30m
- Merged PRs (30d)
- 874
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
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 coder/xum
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
approved backlog
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
approved backlog
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
approved backlog
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
homarr-labs/dashboard-icons#2939 ·
Maintainers usually reply within 1 day
-
Agent/category reasoning variants are still checked against the stale model cache in chat.paramsOpenopencode
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
code-yeongyu/oh-my-openagent#10003 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Actions on ToastsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
nextcloud-libraries/nextcloud-dialogs#2669 ·
Maintainers usually reply within 1 day