[Bug]: Opening PR diff crashes with file/directory path collision
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 56/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- frontend, testing-qa
Research direction
Start with PullRequestCodeTab.tsx, diffFileTree.logic.ts, and DiffFileTree.tsx, then trace how parsed diff paths reach model.resetPaths. Reproduce a file-to-directory and directory-to-file transition involving a path prefix, including both initial and refreshed PR contents. Done means the diff opens, every changed file remains selectable, and regression coverage includes both transition directions.
Written by the indexing model from the issue text.
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Observed on T3 Code desktop:
- Open an affected pull request in PR view.
- Open its diff.
- The view fails with
Path collides with an existing file while creating directory "office".
The affected PR and its path list have not been supplied, so a deterministic reproduction has not yet been confirmed.
Candidate reproduction based on source inspection, not yet run: compare a base revision containing a tracked file or symlink named office against a head revision that replaces it with a directory containing office/config.ts. Ensure the diff includes both the deleted office entry and the added descendant, then open the PR diff with its file sidebar visible. The conflicting segment could also occur deeper in a path.
Expected behavior
The PR diff opens and every changed file remains accessible, including valid file-to-directory or directory-to-file transitions across revisions.
Actual behavior
Opening the diff throws while the file sidebar builds its in-memory tree. The directory creation in the error refers to the tree model, not a filesystem write.
Source inspection at 1de563c1491c7d82563e4553bf5bf689ce6adbb9 suggests a file/directory prefix collision:
- PullRequestCodeTab.tsx derives sidebar entries from the parsed diff files.
- diffFileTreeEntries merges identical paths but retains a file path alongside its descendants.
- DiffFileTree.tsx passes the paths directly to
model.resetPaths, matching the stack trace. A single filesystem tree cannot representofficeas both a file and a directory.
The exact conflicting input remains unconfirmed. The shared component is also used by regular diffs in web and desktop, so those paths merit regression coverage.
A possible fix is to detect prefix collisions and use a flat file list for those diffs, preserving every change and its selection target. Initial construction, appended PR slices, refreshes, and both transition directions should be covered.
Related, but different failures: #11074 and #12244 concern duplicate CodeView IDs for same-path type changes. This report fails in the file-tree model while creating a directory. Searches across open and closed issues for the exact error, getOrCreateDirectoryChild, and diff/tree collision terms found no matching report.
Impact
Major degradation or frequent failure
The affected PR diff cannot be opened. Frequency and impact outside that view are unknown.
Version or commit
T3 Code (Alpha) 0.0.42
Environment
T3 Code desktop, identified by the t3code://app asset URLs. OS/version and provider details were not included in the error report.
Logs or stack traces
T3 Code (Alpha) 0.0.42
Time: 2026-09-21T08:21:30.295Z
Error: Path collides with an existing file while creating directory "office"
at St.getOrCreateDirectoryChild (t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:17435)
at St.appendPreparedPath (t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:15629)
at t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:10946
at I (t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:5114)
at St.appendPreparedPaths (t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:10862)
at new e (t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:52283)
at #le (t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:78951)
at xi.resetPaths (t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:75911)
at Ms.resetPaths (t3code://app/assets/fileTreeExpansion-DN2oJcLV.js:1671:148985)
at de (t3code://app/assets/diffFileContents-CFYwckRB.js:246:3428)
Workaround
No workaround has been verified in T3 Code. The PR can be reviewed outside T3 Code while this is investigated.
- Dominant language
- TypeScript
- Stars
- 23.3k
- Forks
- 6k
- Avg merge
- 10h 57m
- Merged PRs (30d)
- 365
Contributor 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 pingdotgg/t3code
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
accepted bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
accepted bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
accepted bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
All issues in pingdotgg/t3code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·