Skip to content

Mobile: opening an attachment names the file after the link text instead of the imeta filename #8065

Description

@superkim0610

Summary

On mobile, tapping a file attachment link downloads the file and opens it under the link text instead of the attachment's imeta filename. When the label is prose rather than a file name, the opened or saved file loses its real name and extension.

Where

mobile/lib/features/channels/message_content.dart, in _buildLink: the authenticated download is opened with the link text as the file name:

await ref.read(openDownloadedFileProvider)(
  url,
  auth.headersFor(url),
  text,
);

_buildLink already receives the matching ImetaEntry? imeta, and ImetaEntry (mobile/lib/features/channels/message_media.dart) parses filename. It just isn't used here.

Steps to reproduce

  1. Send a message with a non-media attachment whose link label is not the file name, e.g. content [Quarterly report](https://<relay>/media/<sha256>.pdf) with imeta containing filename q3-report.pdf.
  2. Tap the link on mobile.

Expected: the file opens as q3-report.pdf.
Actual: it is opened under Quarterly report, without the .pdf extension, so the system viewer may not recognize it.

Suggested fix

Prefer the imeta filename and fall back to the link text:

imeta?.filename ?? text,

A widget test next to opens local file links through an authenticated download in mobile/test/features/channels/message_content_test.dart can pin it, with a labelled link plus an imeta tag carrying filename.

Activity

  1. added 12 commits that reference this issue on Oct 5, 2026
    b49e87c
    435c2da
    52e962f
    d69b968
    2f05859
    13b4d52
    069361c
    6d637a8
    6ed0ebd
    08e0b37
    e2bdba2
    80c381e
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions