Skip to content

Conversation

@bmarty
Copy link
Member

@bmarty bmarty commented Sep 8, 2025

Content

The file picker will now try to detect the mime type of the selected file.
If it cannot be detected, it will fallback to application/octet-stream.

Motivation and context

Fixes #5254

Screenshots / GIFs

Tests

  • In a timeline, click on the add attachment button
  • select an audio file
  • observe that the preview is now the preview of an audio file.
  • If you send the file, it will be sent as an audio attachment and clients should render it as an audio file

The fix will also apply to other attachments, such as image and video.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

The file picker will now try to detect the mime type of the selected file.
If it cannot be detected, it will fallback to `application/octet-stream`.
@bmarty bmarty requested a review from a team as a code owner September 8, 2025 09:26
@bmarty bmarty requested review from ganfra and removed request for a team September 8, 2025 09:26
@bmarty bmarty added the PR-Bugfix For bug fix label Sep 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/3uuo8h

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2025

@codecov
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.64%. Comparing base (f852fb4) to head (5ffd5b8).
⚠️ Report is 13 commits behind head on develop.

Files with missing lines Patch % Lines
...braries/mediapickers/impl/DefaultPickerProvider.kt 0.00% 4 Missing ⚠️
...s/impl/messagecomposer/MessageComposerPresenter.kt 50.00% 0 Missing and 1 partial ⚠️
.../libraries/mediapickers/test/FakePickerProvider.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5291      +/-   ##
===========================================
- Coverage    79.65%   79.64%   -0.01%     
===========================================
  Files         2258     2258              
  Lines        62491    62493       +2     
  Branches      7830     7832       +2     
===========================================
- Hits         49776    49775       -1     
- Misses        9849     9851       +2     
- Partials      2866     2867       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bmarty bmarty merged commit 1876a53 into develop Sep 9, 2025
33 of 36 checks passed
@bmarty bmarty deleted the feature/bma/fixAudioSending branch September 9, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Bugfix For bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audio files are sent as m.file instead of m.audio

3 participants