Let a staged file be ignored - #43
Merged
Merged
Conversation
A fetch leaves files behind that will never be wanted: a connection since set to balance-only, a window widened once for a backfill, a balances file superseded by the next run. Nothing ever clears them, so they sit at "ready" forever — and a list where most rows are noise is a list nobody reads, which is how the rows that do matter get missed. Staged files can now be ignored from the Import page, and un-ignored, since a dismissal that cannot be undone is one people are reluctant to use. Ignored files drop out of "import all new", which is the sweep a dismissal most needs to stay out of; they stay on disk, and a later fetch that rewrites the file gives it a new hash and a fresh row. This is the one thing the staged listing reads from the state file. The rest of a file's status is derived from the database on purpose, so it stays true across profiles and restores — but "I am never importing this" is a decision about the file, and there is nowhere in the database to learn it from. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Staged files can be ignored from the Import page, and un-ignored.
A fetch leaves files behind that will never be wanted: a connection since set to balance-only, a window widened once for a backfill, a balances file superseded by the next run. Nothing ever cleared them, so they sat at "ready" forever. A list where most rows are noise is a list nobody reads, which is how the rows that do matter get missed.
Type of Change
Details
POST /api/imports/staged/dismisstakes a list of hashes and a boolean, so the same endpoint puts a file back — a dismissal that cannot be undone is one people hesitate to use, and hesitation is what leaves the list full.Ignored files report status
dismissedand drop out of "import all new", which is the sweep a dismissal most needs to stay out of. They stay on disk and in the manifest; a later fetch that rewrites the file gives it a new hash and therefore a fresh row, so ignoring today cannot silently suppress tomorrow's data.The Import page grows an Ignore action beside Import, and Un-ignore on an already-ignored row.
One deliberate asymmetry worth flagging in review: this is the only thing the staged listing reads from the state file. Everything else about a file's status is derived from the database on purpose — that comment is right above the function — so it stays true across profiles and across a backup restore. But "I am never importing this" is a decision about the file, and there is nowhere in the database to learn it from.
Privacy Checklist
Testing
make test(144 passed),make lint,make api-contract-check,make typecheck.A new test walks the whole shape: two ready files, one dismissed, the listing reporting
newanddismissed; then a sweep that picks up only the survivor — the assertion that actually matters, since a dismissal that still gets swept is worse than none; then un-dismissing and seeing it return tonew.Screenshots
The staged table gains an "Ignore" action per ready row; ignored rows read "ignored" with an "Un-ignore" action.
Related Issue
n/a