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

A later settings save can replace a damaged config.json with defaults

Open
#98 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@agentvivekkumar is already working on this.

Since Oct 10, 2026.

Assessment

This issue has not been assessed yet.

Description

Summary

readConfig() returns the default configuration when config.json exists and JSON.parse fails. Launch does not write that result back. bootstrapHiveServices() returns first, because hive.enabled() is false when harnessHome is missing.

A later writeConfig() merges the patch onto those defaults. persistConfig() then writes the result over the damaged file with writeFileSync.

Why this matters

The damaged file can still be repaired. The next settings save can remove the business folder, the mailbox list, and the send rules from disk.

Evidence
  • readConfig() in src/main/config.ts
  • writeConfig() and persistConfig() in src/main/config.ts
  • bootstrapHiveServices() and migrateBusinessFolder() in src/main/index.ts
  • hive.enabled() in src/main/hive.ts

migrateBusinessFolder() runs only after the hive is enabled. It is not the startup overwrite path.

Change

If config.json exists and cannot be parsed, writeConfig() must throw and must not write. Keep the damaged bytes. Use writeFileAtomic for a valid save. A safe atomic write does not make a write of the defaults safe.

Test plan
  • Write { to a temporary config.json.
  • Run the startup path. The file bytes must stay {.
  • Attempt one settings save. The save must fail. The bytes must stay {.
  • A missing config.json may still be created by a real save.
  • A valid config still round-trips.

Checkout: main at 0ef922bac25d6aad226243c72a0a7f142cfacfec.

Dominant language
TypeScript
Stars
273
Forks
211
Avg merge
13h
Merged PRs (30d)
197

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 agentvivekkumar/dontbemichael

All issues in agentvivekkumar/dontbemichael

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.