Mail: Background Bulk Download & Streaming Grid Export Reach QA
Executive summary
This QA promotion (dev → qa, 16 commits) overhauls how large selections leave the Mail app. Bulk "Download as ZIP" now runs as a server-side background job with a live progress panel for big selections, while grid "Export as XLSX" was reworked to stream the file straight back to the browser. The batch also carries a set of smaller fixes across Mail, Admin, and Vendor.
Why this was needed
The previous bulk download assembled ZIPs in the browser, which struggled with large selections and "select all". Separately, an earlier attempt to run XLSX export as a Celery background job hit a SQLAlchemy/greenlet limitation on the backend, so export needed to be realigned to a synchronous streaming approach that the optimized grid service supports. These changes make both flows reliable for large data sets.
Client / user impact
- Bulk ZIP downloads of mails, documents, and batches now handle large selections and "select all": small selections download immediately, while large ones queue a background job with a real-time progress panel and auto-download when ready.
- Grid XLSX export (all 6 grids: Batches, Batch Mails, Inbox, Inbox Mails, Documents, Document Grid) now downloads directly, blocking only briefly (~5s even for thousands of rows) and reflecting the selected/filtered item count.
- Several usability fixes: Upload Center is now required when starting a batch upload; the Admin tenants Type column is no longer sortable; Vendor Filestack sidebar hover states render correctly; and Help-section videos no longer autoplay and default to muted.
Technical scope
Frontend-only (apps/mail, plus admin/vendor fixes). Notable changes from the promoted commits:
- Background bulk download (PR #968/#969): new
bulkZipMails/Documents/Batchesservices and mutations calling POST zip endpoints that return a binary blob (200, ≤50 items) or ajob_id(202, large/select-all). Newdownload-jobsquery/types,BulkZipResultdiscriminated union, and adownloadoperation type wired into the sharedBulkOperationProgresspanel (WebSocket + polling fallback, real file counts, presigned-S3 auto-download). Wired into BatchContents, DocumentContents, MailContents, InboxGrid, MailGrid, DocumentGrid. - Grid export refactor: switched from async job (WebSocket/polling) to synchronous
StreamingResponseto match backend commit1f562a72;ServerExportModalnow POSTs filters, receives a Blob, and triggers an anchor-click download. Removedgrid-export.mutations.ts,grid-export.queries.ts, the export job-status route, and obsolete export response types. - Smaller fixes: required Upload Center in batch upload form; disable sorting on Admin tenants Type column; permission-string syncs (entity→tenant rename, remove dead
MARK_AS_RESOLVED, backend pluralization); Vendor Filestack hover + removal of file-lifecycle-trace feature; Strapi token env-var fixes for the docs chat route; Help videos muted/no-autoplay;cnhelper, duplicate-import, and code-review cleanups.
Risk & mitigation
Moderate. This touches every bulk-download surface and the export modal, and the FE async path depends on backend zip endpoints (/downloads/.../bulk/zip[/server]) returning the expected 200-vs-202 contract and on streaming export from the optimized grid service. The 202 path relies on WebSocket progress with polling fallback and presigned-S3 auto-download. Mitigations: changes are isolated to the Mail frontend with explicit sync/async handling and toast error states, and this is a QA (not Production) promotion, leaving room to validate against real backend responses before going live.
QA validation focus
- Bulk ZIP download for small selections (≤50 items) downloads immediately across mails, documents, and batches.
- Large selections and "select all" queue a background job, show the progress panel with file counts, and auto-download the ZIP on completion; verify WebSocket and polling-fallback paths.
- Grid XLSX export downloads correctly in all 6 grids and the count reflects selected/filtered items, not the grid total.
- Export and download error states surface a toast / failed status (no silent failures).
- Batch upload: Upload Center is required. Admin tenants: Type column is not sortable.
- Vendor Filestack sidebar hover renders above the drop area; Help videos do not autoplay and start muted.
- Permission-gated actions still appear correctly after the permission-string renames.