Attachments end-to-end: drafts, replies and scheduled posts (fase 2b) #145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fase-2b-kabel-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fase 2b van "nieuw bericht opstellen + plannen". Base: main.
Bijlagen reizen nu end-to-end als geparkeerde refs (owned uuids) door concept, direct antwoord en gepland bericht, en uploaden pas naar Mattermost op het moment van verzenden (dat ontwijkt de 7-daagse vervaltermijn van MM voor niet-gekoppelde bestanden). De oude
POST /cards/{id}/files-route (MM file_id-currency) is geschrapt ten gunste van de kaartlozePOST /outgoing-files(ref-currency). Een dagelijkse orphan-sweep ruimt geparkeerde bestanden op die na 7 dagen door geen enkele rij meer worden gerefereerd.Uit de adversariele review-pass (security / correctness / WCAG)
_delete_orphan_refsis per-eigenaar gescoped;outgoing_filesfaalt dicht op een eigenaarloze sidecar.BIO/DPIA/NeRDS-review-fixes (in deze PR verwerkt)
waggle-parkedfile-v1).Poorten
Backend 1398 tests, 100% coverage; frontend tsc + vitest + build + eslint; pre-commit schoon. Postgres-parity + e2e via CI.
Attachments now travel as parked refs (owned uuids) through draft, immediate reply and scheduled send, and upload to Mattermost only at send-time, dodging MM's 7-day unattached-file expiry. The old POST /cards/{id}/files route is retired in favour of the card-less POST /outgoing-files; the reply route validates refs at request-time and again at send-time. A daily orphan sweep reaps parked files no row references after a 7-day TTL, wired into the lifespan and reported in get_task_statuses. Fixes from the adversarial review pass (security / correctness / WCAG): - Draft attachments now rehydrate on load. The save side was wired but not the load side, so reopening a draft showed no chips and the first keystroke PUT an empty file_refs list, detaching and reaping the bytes. useFileUpload.seedDone restores parked files as done entries and useServerDraftSync seeds lastSavedRefs from the server so no empty list is ever sent. - A file removed mid-upload no longer leaks: the finished upload's ref is deleted instead of lingering to the sweep and eating the user's quota. - A pending draft-save is flushed on unmount, so closing the card modal inside the 500ms debounce no longer drops an edit (notably an attachment removal). - An immediate reply now drops the server draft, so its content and now-sent refs do not linger and reload later. - Upload failures are announced in an aria-live region and marked with text, not colour alone; a failed attachment gives an actionable reason instead of the misleading "wait until uploads finish". - An upload response without a usable ref is treated as a failure. - scheduled_runner._settle_sent deletes parked files only after STATE_SENT has committed; a crash in the old window turned a real send into a FAILED row whose bytes were already gone. - _delete_orphan_refs is scoped to the owner: refs are per-user-unique, so the tenant filter is now an explicit invariant, not a bet on uuid uniqueness. - outgoing_files stat_ref/delete_ref fail closed on an ownerless sidecar (no `None != None` fall-through). - The new sweep symbols are exported from cleanup_runner.__all__. Backend stays at 100% coverage; parity verified on Postgres.37d283d7205b59b3ad04Connect the attachment cable end-to-end and harden it (fase 2b)to Attachments end-to-end: drafts, replies and scheduled posts (fase 2b)- A dragged file is always attached, never inserted at a caret, so the ProseMirror drop-cursor (which promised placement) is turned off, and a dragover overlay ('Sleep bestanden hier...') makes the drop target explicit. - Attachment chips show an image thumbnail (client-side object URL, revoked on removal/unmount) or a paperclip icon; there is no read-back route, so a rehydrated image falls back to the icon.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.