Skip to content

feat(core): local crash-log file store#3

Merged
gandarfh merged 1 commit into
mainfrom
feat/crash-log
Jun 16, 2026
Merged

feat(core): local crash-log file store#3
gandarfh merged 1 commit into
mainfrom
feat/crash-log

Conversation

@gandarfh

Copy link
Copy Markdown
Member

Adds a small file-backed crash-log store under <data_dir>/crashes,
shared by the desktop panic hook and the language server's top-level
exception handler. Plain-text files, never uploaded; the desktop
"Crashes" settings panel reads them back.

  • crashes_dir()<data_dir>/crashes
  • write_crash(dir, source, body) — panic-safe, best-effort, returns the
    file name (<epoch_ms>-<source>.log); sanitizes the source tag so it
    can't inject a path separator
  • list_crashes(dir) — newest-first metadata (name, source, epoch_ms,
    first-line summary); skips malformed names; missing dir → empty
  • read_crash(dir, name) — rejects path traversal (bare file name only)
  • clear_crashes(dir) — removes only .log files; missing dir is a no-op
  • 8 unit tests

@gandarfh
gandarfh merged commit 3a36cc7 into main Jun 16, 2026
3 checks passed
@gandarfh
gandarfh deleted the feat/crash-log branch June 16, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant