Fix/seed master data product cost#56
Merged
ilramdhan merged 2 commits intoJun 29, 2026
Merged
Conversation
Replaces single-shot 56MB file upload with browser-side chunking: - SheetJS (xlsx) parses the Excel file in the browser - Groups rows by legacy_oracle_sys_id, splits into chunks of 300 products - Uploads each chunk (~60-90K rows, ~7-8MB) sequentially via existing bulk_params_only endpoint - Each chunk runs as an independent import job — no single long DB transaction that drops with "unexpected EOF" - Progress UI: chunk badge grid (pending/uploading/polling/done/failed) - Resume: retry button starts from first failed chunk, not the beginning - Supports split-part sheets: product_parameters + product_parameters_2 Fixes: unexpected EOF on CAPP batch upsert for large params files. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…able Replaces the synchronous (main-thread-freezing) SheetJS parsing with a proper Web Worker implementation. Key changes: Architecture: - chunked-importer.worker.ts: generic worker — accepts SheetGroupConfig[] + keyColumn; same binary handles any Excel import format - chunked-importer.ts: public API with pre-built configs: PARAMS_ONLY_CONFIG, BULK_ROUTING_CONFIG; new formats add a config constant - Back-pressure protocol: main thread sends 'next' per chunk → worker creates one Blob at a time → ArrayBuffer transferred (zero-copy, detached) → peak main-thread extra memory ≈ 7MB (vs loading all 47 chunks at once) Why Web Worker: - XLSX.read() on 58MB file blocks JS event loop for 30-90s → tab freeze - Worker runs on a separate thread; UI stays responsive throughout - Zero-copy ArrayBuffer transfer between worker and main thread Updated params-only dialog uses PARAMS_ONLY_CONFIG and ChunkResult from the new generic API. Old params-chunker.ts/worker.ts removed. Co-Authored-By: Claude Sonnet 4.6 (1M context) <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.
Description
Type of Change
Module/Component Affected
Changes Made
Related Issues
Fixes #
Related to #
Screenshots
Before
After
Testing Performed
Manual Testing
Browser Testing
Build Verification
npm run lintpassesnpx tsc --noEmitpassesnpm run buildsucceedsAccessibility
Performance
Pre-merge Checklist
Reviewer Notes