Skip to content

Bug: a message advertises an attachment whose blob is gone #3017

Closed

Description

@Israeltheminer

A conversation message can advertise an attachment whose bytes no longer exist. It renders, and the download 404s with no explanation.

Mechanism

materialize_email_attachments.ts builds the download URL at ingest and stores it in the message metadata. The URL therefore survives the blob disappearing — the message keeps offering it indefinitely.

Observed on a live deployment: one inbound message advertising a ~26 KB attachment with a download URL set, and neither a fileMetadata row nor a stored blob behind it. Confirmed cause on that deployment: a recovery cycle exported and re-imported the database without file storage, so rows came back and blobs did not.

Why it is worth fixing anyway

The import was the trigger, but nothing in the product notices the state. Any deployment that loses a blob — a restore, a bucket migration, a failed write — keeps showing attachments that cannot be fetched, and the failure surfaces as a browser error rather than as an explanation.

Shape

Either resolve the attachment at render or serve time rather than trusting the stored URL, or mark the attachment when its blob cannot be found so the UI can say so. A dangling attachment should read as "no longer available", not as a broken link.

Priority

Deferred by the owner. Filed so it is not rediscovered from scratch.

Activity

  1. added a commit that references this issue on Sep 4, 2026
    4718c24
  2. Israeltheminer commented on Sep 4, 2026

    @Israeltheminer
    ContributorAuthor

    Fixed by #3193, merged.

    presignMessageAttachments now probes for the object before offering it, and drops the URL rather than merely flagging it — a dead link next to a "no longer available" notice would be the same bug. The probe fails open: an unreachable store or unresolved org throws, and a throw is not evidence of absence, so the attachment is offered as before and the reason is logged. Only a definite null marks it.

    conversations.attachment.unavailable" in en/de/fr, and attachment-presence.test.ts` covers all three branches. The fail-open direction is the one worth having a test for — failing closed on a throw would hide every attachment whenever the blob store blipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: lowservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions