Skip to content

[Import] Retry clobbers restored mappings; stale mapped records can re-push the entire original dataset #51

Description

@Exotic209093

Severity

High — two related state-invalidation gaps in the staged Import workflow.

What happens

  1. handleRetry loads the failed-rows dataset and calls setMappings(lastPushConfig.mappings), but the automap effect keyed on dataset?.filename fires on the same commit and overwrites the restored mappings — manual mapping choices (renames, transforms, blank behavior, lookups) are silently lost.
  2. mappedRecords, validationErrors, and furthestStage are never invalidated when the dataset changes, so after loading the retry dataset (or any new file) the user can click straight to Review — still gated on the old validationErrors: [] — and Confirm pushes the previous mappedRecords: all original rows re-sent, duplicating every already-successful record.

Evidence

  • src/ui/screens/DataPushScreen.tsx:328 (automap effect) vs :564 (restore), :173/:393 (stale state)

Suggested fix

Reset mappedRecords/validationErrors/furthestStage whenever the dataset changes, and skip the automap effect when mappings were just restored programmatically.

Environment

Commit 74cf21b (main), WaveLink 0.6.0. Found in the 2026-08-31 adversarial audit (code-verified).

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions