Allow large activity Excel imports (40k+ rows) with bigger chunks and caches.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-03 17:42:11 +03:30
co-authored by Cursor
parent beae16437b
commit c629729a9a
4 changed files with 96 additions and 22 deletions
+2 -10
View File
@@ -319,16 +319,8 @@ export async function previewExcel(
const missingRequired = required.some((key) => !mapped.has(key));
const unrecognized = columns.some((col) => !suggested[col.header]);
let rowCount = 0;
sheet.eachRow((row, rowNumber) => {
if (rowNumber === 1) return;
let any = false;
row.eachCell((cell) => {
if (any) return;
if (cellStr(cell.value)) any = true;
});
if (any) rowCount += 1;
});
// برای فایل‌های خیلی بزرگ (ده‌ها هزار ردیف) پیمایش کامل کند است؛ rowCount شیت کافی است
const rowCount = Math.max(0, (sheet.actualRowCount || sheet.rowCount || 1) - 1);
return {
columns,