Skip to content

[BUG] Dump size sweeping evicts individual files, leaving unusable partial dumps #154

Description

@iceteaSA

dumpRequest() writes several files that share one dump id — body, metadata, and optionally relay/request artifacts — and the metadata references the others. The size-cap sweep in packages/core/src/dump.ts treats each file as an independent unit: it collects individual paths, sums their sizes individually, and unlinks them one at a time in sort order.

Nothing groups them by dump id, so when the sweep frees space it can delete a .body.json while keeping its .meta.json (or vice versa). What survives is metadata pointing at content that no longer exists — a dump that costs disk but can't be used for the diagnosis it was captured for. Trimming to a byte cap by deleting the oldest whole dumps would free the same space and leave every remaining dump intact.

Trigger: set a dump cap below an existing artifact group's combined size, let the files age past the newness floor, and run the sweep.

Fix direction: group files by dump id, compute size per group, and evict whole groups atomically — so the cap is enforced in units that match what a dump actually is.

Low severity: it only affects debug captures, and only when the cap is actually biting. Filing it because the failure is silent — you don't find out until you go to read a dump and the body is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions