Skip to content

fix: keep snapshot imports from clearing the wrong table - #258

Merged
vincentkoc merged 1 commit into
mainfrom
fix/archive-validation
Nov 19, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/archive-validation

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

A full snapshot import of a table named " messages" or "messages " clears "messages" instead. The import can succeed after deleting unrelated rows while leaving stale rows in the intended table.

User Impact

Full imports now replace rows in the exact named table and preserve the unrelated unpadded table. Custom delete callbacks receive the exact table name. Blank delete-list entries remain ignored; no API or snapshot format changes are required.

Why This Change Was Made

Keep the original table name when clearing rows, matching how the importer inserts them. Whitespace trimming is used only to recognize blank list entries.

Evidence

All eight regression cases failed before the fix and pass afterward. They cover leading and trailing spaces, inferred and explicit delete lists, and generic and custom deletion. Each checks that stale rows disappear and unrelated rows survive. Local library validation passed. Independent native review found no P0–P3 issues.

Validation details
  • GOWORK=off go test -count=1 ./snapshot -run '^TestImportPreservesLiteralDeleteTableNames$'
  • GOWORK=off go mod tidy
  • git diff --exit-code -- go.mod go.sum
  • GOWORK=off go vet ./...
  • GOWORK=off go test -count=1 ./...
  • git diff --check
  • Reviewed candidate: eaaf2a0d958411dad8890cfe7a17df10a9cf6849
  • Base: bf9bdd162a3cc5595926f145abfb2202e3bba880

@clawsweeper

clawsweeper Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc
vincentkoc marked this pull request as ready for review November 19, 2026 06:17
@vincentkoc
vincentkoc merged commit 39f4437 into main Nov 19, 2026
8 checks passed
@vincentkoc
vincentkoc deleted the fix/archive-validation branch November 19, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant