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

Windows file helper truncates a file before writing it, so a crash can leave it short

Closed
#259 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust, typescript

Research direction

This bundles six separate fixes, so pick one and ignore the rest. The smallest candidates are the __proto__ key in files at code_index.ts:364 (use a Map or Object.create(null)) and the doc contradiction at ARCHITECTURE.md:258 versus line 235. Done means the chosen fix is in place and its test or doc check passes. Ask the maintainer before touching the Windows helper at windows.rs:192-194, since that change needs a durability design.

Written by the indexing model from the issue text.

Description

bug priority: low severity: low

Found in the 2026-10-09 codebase audit.

Small issues, each low impact:

  • MCP stop during connect leaves a server running. If stop() runs while connectOne awaits stdioTransport, closeClient clears state.connecting before the process exists; connectOne then spawns it and if (this.stopped) await closeClient(state) closes nothing. Fix: close the local client in that branch.
  • Terminal output after a project switch. pty.onData (panels/terminal.ts:38) is not guarded by this.pty === pty, unlike onExit, so output from the killed old shell can reach the new terminal. Needs verification.
  • Git panel diff fails on an untracked symlink. GitService.diff() (git.ts:329) calls resolve outside a try, so one link pointing outside the project fails the whole diff instead of skipping that file.
  • Prototype-named files in the code index. A file named __proto__ sets the prototype of files (code_index.ts:364) and is re-embedded on every update. Use Object.create(null) or a Map.
  • Durability. writeJson (storage/json_file.ts) never fsyncs before rename, and the Windows helper truncates a file before writing it (windows.rs:192-194); a crash or power loss can leave an empty file.
  • Doc inconsistency. ARCHITECTURE.md:258 says the Git panel's Commit and Push run the repository's hooks; line 235, the README and the code (core.hooksPath disabled) say they don't.
Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
5h 28m
Merged PRs (30d)
24

Getting set up

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 PierrunoYT/patch

All issues in PierrunoYT/patch

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.