[P1 reliability] Import pipeline buffers and duplicates the entire corpus in browser memory #138
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-review
quasar
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/quasar-ui#138
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
The import path is whole-buffered at every stage.
parseFile()loads each file completely:JSONL then allocates an additional full line array:
collectImportDocuments()retains every parsed file in a map and then copies all documents/origins into combined arrays.importFiles()creates additionalrecords,candidateRecords,candidates, andoriginsarrays. The batch layer then creates validated copies, ID maps, key arrays, existing-document maps, and write arrays before calling one largebulkDocs().There is no total-byte, record-count, per-record-size, cancellation, progress, or backpressure boundary.
For large StarIntel JSONL corpora, peak memory can be several times the input size and all parsing/validation occurs on the UI thread. A sufficiently large import can freeze or crash the tab before any useful error or recovery state is persisted.
Required fix
Build a streaming, cancellable import pipeline in a worker with bounded chunks and connect it to the logical batch journal from the atomicity issue.
Stream JSONL
Validate and commit bounded chunks
Do not expose staged chunks to normal corpus queries until the batch commit marker is durable.
Worker protocol
Use transferable streams where supported; otherwise keep parsing in the worker and send bounded structured-clone chunks.
Enforce explicit limits
At minimum:
Limits should be configurable for desktop deployments, with excess errors streamed to an export rather than retained in RAM.
Acceptance criteria