feat(inbox): staged upload ack, HEIC/HEIF validation, WhatsApp silence fixes (#1605)

* fix(whatsapp): app-side unmute, close silent intake paths, health visibility

- add POST /link/unmute and a Reactivate control on the Pausad state
- company resolution: transient query errors release the row for sweep
  retry; genuine zero-options sends M19 instead of parking silently
- media from unlinked senders bypasses the hourly greeting throttle
  (10 min burst window, daily cap kept)
- GET /link returns 7-day failed-delivery and parked-inbound counts;
  sweep summary logs outboundFailed24h

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(documents): real HEIC/HEIF magic-byte validation, bilingual upload errors

- detect ISO-BMFF ftyp brands (heic/heix/heim/heis/hevc/hevx/hevm/hevs,
  mif1/msf1) instead of exempting image/heic from validation; declared
  heic/heif accepts either family member (iOS labels vary)
- new INBOX_UPLOAD_* structured error codes replace raw English strings
  on the inbox upload and attach-document routes
- registry doc corrected to the real 10 MB cap

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(inbox): staged upload with instant ack and deferred AI extraction

- web uploads insert the inbox item as status processing and respond
  immediately; Bedrock extraction and supplier match run via after()
  with a CAS flip to received (email and WhatsApp channels keep the
  synchronous path)
- widen invoice_inbox_items.status CHECK to include processing
  (migration 20260813180000, pg-real test included)
- crash-recovery sweep cron (*/2) flips stale processing rows;
  bulk-book skips extraction_in_progress items
- workspace: processing chip, in-flight rows disable actions, realtime
  flip, retry-extraction button for empty extractions
- picker accept list drops HEIC/HEIF so iOS transcodes library photos
  to JPEG; server allowlists unchanged (supersedes 2026-08-01 HEIC
  decision, see DECISIONS.md)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(migrations): bump inbox processing-status migration past main's latest

Main merged 20260813210000 while this PR was in flight; an inserted
version older than the latest applied aborts the prod db push at merge.
Renamed 20260813180000 to 20260813213000 and updated references.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(decisions): log preview-tracker orphan repair after migration rename

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Mattsson
2026-08-13 23:57:53 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent 456366fa70
commit 4a9fa5e6c5
40 changed files with 1732 additions and 127 deletions
+8 -2
View File
@@ -3051,7 +3051,10 @@
"code_expired": "The code has expired. Create a new one.",
"linked_number_label": "Linked number",
"muted_label": "Paused",
"muted_hint": "You paused the chat with stopp. Send start in WhatsApp to activate it again.",
"muted_hint": "You paused the chat with stopp. Reactivate here or send start in WhatsApp. After reactivating here, just send your next receipt as usual: we cannot send a confirmation in WhatsApp until you write again.",
"unmute_button": "Reactivate",
"unmuted_toast": "The chat is active again.",
"unmute_failed": "Could not reactivate the chat.",
"default_company_label": "Default company",
"default_company_help": "If you belong to several companies, this controls which company's Underlag your receipts land in.",
"default_company_none": "None selected",
@@ -3074,7 +3077,8 @@
"last_event_muted": "ignored: the chat is paused",
"last_event_declined": "not answered",
"last_event_failed": "could not be received",
"last_reply_failed": "Our latest reply could not be delivered in WhatsApp. Check that the number can receive messages from Accounted."
"last_reply_failed": "Our latest reply could not be delivered in WhatsApp. Check that the number can receive messages from Accounted.",
"health_warning": "{count, plural, one {1 message could not be delivered or processed in the last week.} other {# messages could not be delivered or processed in the last week.}} Check the link or contact support."
},
"inbox_bulk_book": {
"total_label": "Total for the documents: {amount}",
@@ -3168,6 +3172,8 @@
"heic_hint": "HEIC images cannot be AI-extracted yet. Upload the receipt as JPEG or PDF, or fill in the fields manually.",
"skipped_hint": "AI extraction did not run for this document. You can link the document to a transaction or create a supplier invoice manually.",
"retry_overwrite_confirm": "Re-running extraction overwrites the fields, including your own edits. Continue?",
"processing_chip": "Reading with AI…",
"retry_extraction": "Read with AI again",
"expand_fields": "Open the fields in a larger view",
"wa_block_title": "From WhatsApp",
"wa_caption_label": "Message",
+8 -2
View File
@@ -3051,7 +3051,10 @@
"code_expired": "Koden har gått ut. Skapa en ny.",
"linked_number_label": "Kopplat nummer",
"muted_label": "Pausad",
"muted_hint": "Du har pausat chatten med stopp. Skicka start i WhatsApp för att aktivera den igen.",
"muted_hint": "Du har pausat chatten med stopp. Återaktivera här eller skicka start i WhatsApp. Efter återaktivering här skickar du bara nästa kvitto som vanligt: vi kan inte skicka någon bekräftelse i WhatsApp innan du själv skriver igen.",
"unmute_button": "Återaktivera",
"unmuted_toast": "Chatten är aktiv igen.",
"unmute_failed": "Kunde inte återaktivera chatten.",
"default_company_label": "Standardföretag",
"default_company_help": "Är du med i flera företag styr valet vilket företags Underlag dina kvitton hamnar i.",
"default_company_none": "Inget valt",
@@ -3074,7 +3077,8 @@
"last_event_muted": "ignorerades: chatten är pausad",
"last_event_declined": "besvarades inte",
"last_event_failed": "kunde inte tas emot",
"last_reply_failed": "Vårt senaste svar kunde inte levereras i WhatsApp. Kontrollera att numret kan ta emot meddelanden från Accounted."
"last_reply_failed": "Vårt senaste svar kunde inte levereras i WhatsApp. Kontrollera att numret kan ta emot meddelanden från Accounted.",
"health_warning": "{count, plural, one {1 meddelande kunde inte levereras eller behandlas den senaste veckan.} other {# meddelanden kunde inte levereras eller behandlas den senaste veckan.}} Kontrollera kopplingen eller kontakta support."
},
"inbox_bulk_book": {
"total_label": "Underlagens summa: {amount}",
@@ -3168,6 +3172,8 @@
"heic_hint": "HEIC-bilder kan inte AI-tolkas ännu. Ladda upp kvittot som JPEG eller PDF, eller fyll i fälten manuellt.",
"skipped_hint": "AI-tolkning kördes inte för det här dokumentet. Du kan koppla dokumentet till en transaktion eller skapa leverantörsfaktura manuellt.",
"retry_overwrite_confirm": "Ny tolkning skriver över fälten, även ändringar du gjort själv. Fortsätta?",
"processing_chip": "Tolkar med AI…",
"retry_extraction": "Tolka med AI igen",
"expand_fields": "Öppna fälten i större vy",
"wa_block_title": "Från WhatsApp",
"wa_caption_label": "Meddelande",