Skip to content

Exporting an older scan batch produces an empty (0-byte) file #5

@ThunderRonin

Description

@ThunderRonin

Description

After running more than one scan in a session, exporting the IPs of an older batch yields an empty / 0-byte file, even though the History entry still shows the correct success count. The export of the batch that is currently "live" works; subsequent exports of aged-out batches are empty.

Steps to reproduce

  1. Run a scan, then export Valid IPs (TXT) → file has content. ✅
  2. Run a second scan.
  3. Go to History → Export Valid on the first scan (or use Valid IPs (All)).
  4. Downloaded file is 0 bytes, despite the History entry showing N successes. ❌

Root cause

In src/App.tsx:

const mergedResults = liveResults.length ? liveResults : allResults;

liveResults holds only the current batch (reset at each scan start). allResults accumulates every batch (persisted to localStorage). Because the ternary returns liveResults whenever it's non-empty, a finished scan shadows allResults, so any export filtering mergedResults by an older batchId finds nothing → empty file.

Expected

Exporting any batch from History (and "All") returns its results regardless of how many scans ran afterwards.

Fix

Make mergedResults a deduped union of the live batch and all persisted batches. (PR opened.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions