QA Promotion: Local-Timezone Timestamps, Safer ZIP Batch Previews, and Rules/Tags Cleanup
Executive summary
A batch promotion advancing the current development build into the QA environment for testing. It bundles three changes to the Mail app: timestamps now display in each viewer's own local time zone instead of fixed US Central time, a fix that stops ZIP batch archives from silently downloading when opening Edit Batch, and a cleanup that hides an unfinished rule auto-apply workflow and removes unsupported tag/rule API calls.
Why this was needed
Three distinct issues motivated this batch:
- Timezone display: every timestamp was hardcoded to US Central time, so users outside that zone saw times that did not match their own clock.
- Silent ZIP downloads: opening Edit Batch on a ZIP-backed batch could auto-download the raw archive to the user's machine, because the preview pane was handing a
.zipURL to a PDF viewer that browsers cannot render inline. - Contract drift (BUG-017): the frontend still carried calls for rule and tag management endpoints (auto-apply, activate, tag create/update) that the backend does not currently expose, plus an auto-apply UI for a workflow product had not re-enabled.
Client / user impact
- Timestamps across the Mail app now render in the viewer's local device time zone (same MM/DD/YYYY visual format), so a user in Mumbai and a user in Chicago each see the correct local wall-clock time for the same moment.
- Opening Edit Batch on a ZIP batch no longer triggers an unexpected file download; the preview shows a loader while extraction runs and a clear placeholder for archives.
- The unfinished "Auto Apply Rules" buttons no longer appear in Admin Hub, and the app no longer calls tag/rule endpoints that would error, reducing confusing failures.
Technical scope
Promotion of dev into qa, bundling three feature branches (Mail app + shared UI package):
- Local-timezone timestamps (#1046):
packages/ui/src/utils/format-date.tsdrops theAmerica/ChicagoTZDatepin; a newnormalizeTimestampStringhelper treats zone-less datetimes as UTC (per backend contract) and pins date-only strings to local midnight to avoid day-rollback in negative-offset zones, thendate-fns format()renders in local time. Removes the now-unused direct@date-fns/tzdependency frompackages/ui/package.json. - Silent ZIP download fix (#1045): adds a strict
hasZipExtensionhelper infileValidation.ts;useEditBatchZipProcessingonly ever surfaces extracted blob entries (never the raw.zipURL);FilePreviewroutes archives to a download-card and shows a preparing loader before the empty state;pdf-viewer/index.tsxrefuses to mount the iframe for.zipURLs as a defense-in-depth guard;AddBatchModalreports edit-mode loading state. - Friday 12th June fixes (#1044): adds a
rulesAutoApplyfeature flag (defaultfalse) gating all Auto Apply Rules buttons/modals inRulesTab.tsxand the rules page; removes ~1,000 lines of unsupported frontend wrappers for rule management/test/execute/templates/analytics endpoints and standalone tag create/update (read-onlygetTagsretained).
Risk & mitigation
Low-to-moderate. The timezone change touches a shared helper used by every timestamp across admin, mail, and vendor apps, so any regression would be broad; mitigated because the visual format is unchanged and only the rendered offset differs. The ZIP and rules changes are net-removals or additive guards that reduce surface area. Tag/rule mutation removal is safe only if no remaining code path calls those wrappers (PR notes a source check found no references). Watch for hydration warnings from server/client timezone mismatch.
QA validation focus
- Verify timestamps render in your local time zone on the qa deploy from a non-Central time zone; confirm visual format stays MM/DD/YYYY and date-only fields do not shift by a day; watch the browser console for hydration warnings.
- Open Edit Batch on a ZIP-backed batch and confirm NO automatic download occurs; confirm a loader shows during extraction and extracted PDFs preview correctly.
- Confirm the "Auto Apply Rules" button is hidden in Admin Hub Rules (single and bulk-selection views) while the flag is off.
- Smoke-test document tag creation through the upload/update flow (via
new_tags) and confirm rule list/create/update/delete still work.