Skip to content

Editing the ignore file can lose reasons or overwrite malformed content #43

In review

Description

@sh00kapic

Two isolated fixtures reproduced data loss. First, change an existing reason on disk and ignore a different finding. The next write restores the old reason because reload compares fingerprints only. Second, introduce a JSON syntax error and add a finding. The file is replaced with a list containing only the new entry.

Expected behavior and verification

Honor external metadata edits even when fingerprints are unchanged. Distinguish a missing file from an unreadable or invalid one before writing. Preserve the original content on failure, surface the problem and cover both cases with regression tests.

ctrace/FindingIgnoreList.ts line 88 · ctrace/FindingIgnoreList.ts line 105

Activity

  1. added
    bug
    on Nov 20, 2026
  2. Arthurvroum commented on Nov 25, 2026

    @Arthurvroum
    Collaborator

    Fixed on branch 43-ignore-file-data-loss (eb387dd), pull request #56.

    • Every reload takes the entries exactly as they are on disk. A reason edited externally is kept even when the set of fingerprints is unchanged. Other top-level keys are kept when the file is rewritten.
    • A missing file ignores nothing. An unreadable or invalid file keeps the entries read before and is reported once, and ignore/restore refuse to write over it.
    • Writes go to a temporary file that is then renamed, so an interrupted write cannot truncate the file.

    Tests: an external reason edit followed by ignoring another finding, a JSON syntax error (the file is left untouched and reported), and valid JSON that is not an ignore list. Unit and workspace suites pass locally (Linux).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions