Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🤖 fix: config load drops workspace rows when two project keys normalize to the same path

Open Beginner friendly
#5,926 2 comments 0 reactions 0 assignees View on GitHub

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

bug investigation

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coder/xum

All issues in coder/xum

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.