#121

Long project names lose the path hash, so separate directories share one d3k project dir

OpenRaphaelFakhriopened 23d ago

getProjectName() in src/utils/project-name.ts appends a 6-character path hash to keep project directories unique, then truncates the whole string to 50 characters. When the sanitized name is longer than 43 characters, the hash is cut off.

Steps to reproduce

  1. Create two checkouts (for example, two git worktrees) of a package whose sanitized package.json name is 49 characters or longer, such as @acme-corp/marketing-website-frontend-application-v2.
  2. Call getProjectName() for each directory, or run d3k in both.

Expected behavior

Each directory gets its own ~/.d3k/<project>-<hash>/ directory.

Actual behavior

Both directories resolve to acme-corp-marketing-website-frontend-application-v, with no hash. Names between 44 and 48 characters keep only part of the hash, so they collide less often but still can. The two d3k instances share logs, the Chrome profile and session.json, so d3k logs, d3k errors and the browser session can point at the other checkout. getProjectDisplayName() also stops stripping the suffix, because no full hash is left.

Activity

0

No activity yet.