Skip to content

[Import] Rows dropped at mapping stage shift all downstream indices — error file and retry target the wrong rows #46

Description

@Exotic209093

Severity

High — retry duplicates already-successful records and the error file blames the wrong rows.

What happens

mapRecords excludes rows with mapping errors from mappedRecords, so push-error recordIndex values refer to the compacted array. The UI then applies those indices to the uncompacted sourceRecords. With one dropped row, every failure after it is attributed to the wrong source row: WaveLinkSourceRow in the error file is off by one per drop, and Retry Failed Rows re-sends rows that already succeeded (duplicate inserts) while omitting the rows that actually failed.

Evidence

  • src/data/mappers/index.ts:154-156
  • src/ui/screens/DataPushScreen.tsx:553 (buildRetryDataset), :578 (buildPushOutcomeDatasets)

Suggested fix

Keep an index map from mapped-record position back to source-record position (or keep failed rows as placeholders) and translate indices before building retry/outcome datasets.

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