Skip to content

Commit a7210b1

Browse files
committed
MDH: drop inaccurate 'significant memory' warning from large download/export modals
The download/export engine streams each batch directly to disk via showSaveFilePicker, with backpressure capping the in-flight working set at ~20k docs (MAX_BUFFERED * BATCH_SIZE) regardless of total size. Peak memory is bounded and independent of collection size on that path, so the 'use significant memory' warning was misleading. Only the rare Blob fallback (picker unavailable/denied) holds the full output in memory. Reword all 8 confirm modals (JSON/NDJSON download + CSV/XML export, full and filtered) to keep the accurate 'may take a while' and drop the memory claim. No 'streams to disk' assertion added, since the Blob fallback does not stream.
1 parent 7aacbb9 commit a7210b1

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/mdh/components/DataPanel.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export default function DataPanel() {
432432
if (tc !== null && tc > 10_000) {
433433
const proceed = await confirmModal(
434434
'Large collection',
435-
`This collection has ${tc.toLocaleString()} documents. Downloading may take a while and use significant memory. Continue?`,
435+
`This collection has ${tc.toLocaleString()} documents. Downloading may take a while. Continue?`,
436436
);
437437
if (!proceed) return;
438438
}
@@ -496,7 +496,7 @@ export default function DataPanel() {
496496
setDownloadState(null);
497497
const proceed = await confirmModal(
498498
'Large download',
499-
`This filter matches ${filteredCount.toLocaleString()} documents. Downloading may take a while and use significant memory. Continue?`,
499+
`This filter matches ${filteredCount.toLocaleString()} documents. Downloading may take a while. Continue?`,
500500
);
501501
if (!proceed) return;
502502
}
@@ -512,7 +512,7 @@ export default function DataPanel() {
512512
async function downloadAllJsonl() {
513513
const tc = pagination.totalCount.value;
514514
if (tc !== null && tc > 10_000) {
515-
const proceed = await confirmModal('Large collection', `This collection has ${tc.toLocaleString()} documents. Downloading may take a while and use significant memory. Continue?`);
515+
const proceed = await confirmModal('Large collection', `This collection has ${tc.toLocaleString()} documents. Downloading may take a while. Continue?`);
516516
if (!proceed) return;
517517
}
518518
const col = collection;
@@ -562,7 +562,7 @@ export default function DataPanel() {
562562
if (downloadCancelRef.current) { setDownloadState(null); return; }
563563
if (filteredCount > 10_000) {
564564
setDownloadState(null);
565-
const proceed = await confirmModal('Large download', `This filter matches ${filteredCount.toLocaleString()} documents. Downloading may take a while and use significant memory. Continue?`);
565+
const proceed = await confirmModal('Large download', `This filter matches ${filteredCount.toLocaleString()} documents. Downloading may take a while. Continue?`);
566566
if (!proceed) return;
567567
}
568568
await runDownloadJob({
@@ -590,7 +590,7 @@ export default function DataPanel() {
590590
if (tc !== null && tc > 10_000) {
591591
const proceed = await confirmModal(
592592
'Large collection',
593-
`This collection has ${tc.toLocaleString()} documents. Exporting may take a while and use significant memory. Continue?`,
593+
`This collection has ${tc.toLocaleString()} documents. Exporting may take a while. Continue?`,
594594
);
595595
if (!proceed) return;
596596
}
@@ -656,7 +656,7 @@ export default function DataPanel() {
656656
setDownloadState(null);
657657
const proceed = await confirmModal(
658658
'Large export',
659-
`This filter matches ${filteredCount.toLocaleString()} documents. Exporting may take a while and use significant memory. Continue?`,
659+
`This filter matches ${filteredCount.toLocaleString()} documents. Exporting may take a while. Continue?`,
660660
);
661661
if (!proceed) return;
662662
}
@@ -683,7 +683,7 @@ export default function DataPanel() {
683683
onDownload={async ({ rootName, recordName }) => {
684684
const tc = pagination.totalCount.value;
685685
if (tc !== null && tc > 10_000) {
686-
const proceed = await confirmModal('Large collection', `This collection has ${tc.toLocaleString()} documents. Exporting may take a while and use significant memory. Continue?`);
686+
const proceed = await confirmModal('Large collection', `This collection has ${tc.toLocaleString()} documents. Exporting may take a while. Continue?`);
687687
if (!proceed) return;
688688
}
689689
await runDownloadJob({
@@ -742,7 +742,7 @@ export default function DataPanel() {
742742
setDownloadState(null);
743743
const proceed = await confirmModal(
744744
'Large export',
745-
`This filter matches ${filteredCount.toLocaleString()} documents. Exporting may take a while and use significant memory. Continue?`,
745+
`This filter matches ${filteredCount.toLocaleString()} documents. Exporting may take a while. Continue?`,
746746
);
747747
if (!proceed) return;
748748
}

0 commit comments

Comments
 (0)