Report import progress from committed records instead of bytes read
The UI reaches 100% while thousands of records are still queued for the database. Operators assume they can close the import.
- Focused work estimate
- 2h + prerequisites
- Priority in the scenario
- Medium
- Engineering practice
- Progress reporting · State modeling
Estimated field mix
- API design40%
- Data engineering40%
- Frontend20%
Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.
Review it, then add it to your workspace.
The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.
Project context
A fictional wholesaler imports supplier rows into a staging catalog. The current prototype reads the entire file into memory and restarts from zero after a failure. Build the prototype and generated CSV fixture locally before measuring improvements.
Setup prerequisites
- Generate a deterministic 250,000-row synthetic CSV with quoted newlines, invalid records and a stated maximum record size.
- Create a disposable staging database and an import process constrained to 256 MiB; record runtime and available CPU.
Preceding work
Complete these dependencies, or supply their agreed outputs before taking this ticket.
- PBATCH-101 · Generate a catalog file that includes difficult CSV boundaries
- PBATCH-102 · Measure peak import memory across parsing, validation and writes
- PBATCH-103 · Attribute import time to parsing, validation and database waits
- PBATCH-104 · Stream records without buffering the rest of the catalog
- PBATCH-105 · Batch staging writes without changing duplicate-SKU behavior
Acceptance criteria
- Expose bytes consumed, records accepted/rejected, committed records and terminal state as separate counters.
- Mark completion only after all accepted records are committed and final reconciliation succeeds.
- Avoid a remaining-time promise when throughput is unstable; report an unknown estimate explicitly.
Implementation constraints
- Keep progress updates throttled and monotonic within one attempt; resumed attempts must disclose their checkpoint origin.
Verification to include
- Pause the final write and verify the import remains nonterminal despite input exhaustion.
- Inject rejection and retry cases and reconcile counters with the final staging contents.
Deliverables
- Progress contract and end-of-input regression
Rollout and recovery
Introduce the progress fields before changing the UI completion rule; retain committed counters if the display is reverted.
Value of the work
For the engineer: Practice streaming, backpressure, allocation analysis and resumable work while retaining exact import semantics.
For the team: Develop a repeatable import performance and recovery exercise that exposes memory, throughput and data-quality tradeoffs.
Evidence boundaries
Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.
Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.