Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearing the cache prevents voice messages being played until app is restarted #1788

Closed
jonnyandrew opened this issue Nov 10, 2023 · 1 comment · Fixed by #1790
Closed

Clearing the cache prevents voice messages being played until app is restarted #1788

jonnyandrew opened this issue Nov 10, 2023 · 1 comment · Fixed by #1790
Assignees
Labels
A-Voice-Messages O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Team: Element X Feature

Comments

@jonnyandrew
Copy link
Contributor

Steps to reproduce

  1. Open a room with several voice messages
  2. Play the voice messages
  3. Put the app in the background
  4. Clear the cache of the app
  5. Resume the app
  6. Try to play the voice messages

Outcome

What did you expect?

Voice messages can be played,

What happened instead?

Voice messages cannot be played or downloaded until app is restarted.

Screen_recording_20231110_170745.webm

Your phone model

Emulator

Operating system version

Android 13

Application version and app store

develop at 2f51919

Homeserver

No response

Will you send logs?

No

Are you willing to provide a PR?

No

@jonnyandrew jonnyandrew added T-Defect Something isn't working: bugs, crashes, hangs and other reported problems A-Voice-Messages S-Minor Impairs non-critical functionality or suitable workarounds exist O-Uncommon Most users are unlikely to come across this or unexpected workflow Team: Element X Feature labels Nov 10, 2023
@julioromano julioromano self-assigned this Nov 13, 2023
julioromano pushed a commit that referenced this issue Nov 13, 2023
`RustMediaLoader` creates the "${cacheDir}/temp/media" dir only once at class creation.
Unfortunately when clearing an app's cache this directory will be deleted, so subsequent usages of the same instance of `RustMediaLoader` will not work because `cacheDirectory` does not exists.
This fix makes sure that such directory is always checked and created if needed.

Fixes #1788
@julioromano
Copy link

@jonnyandrew I can reproduce with any media, not with just voice messages.
E.g. try doing the same with an image, after clearing the cache the media viewer will error.

Fixed in: #1790

julioromano pushed a commit that referenced this issue Nov 13, 2023
<!-- Please read [CONTRIBUTING.md](https://github.com/vector-im/element-x-android/blob/develop/CONTRIBUTING.md) before submitting your pull request -->
 
## Type of change

- [ ] Feature
- [x] Bugfix
- [ ] Technical
- [ ] Other :

## Content

`RustMediaLoader` creates the "${cacheDir}/temp/media" dir only once at class creation. Unfortunately when clearing an app's cache this directory will be deleted and the app's process won't be killed, so subsequent usages of the same instance of `RustMediaLoader` will not work because `cacheDirectory` does not exists. This fix makes sure that such directory is always checked and created if needed.

## Motivation and context

Fixes #1788

## Screenshots / GIFs

<!--
We have screenshot tests in the project, so attaching screenshots to a PR is not mandatory, as far as there
is a Composable Preview covering the changes. In this case, the change will appear in the file diff.
Note that all the UI composables should be covered by a Composable Preview.

Providing a video of the change is still very useful for the reviewer and for the history of the project.

You can use a table like this to show screenshots comparison.
Uncomment this markdown table below and edit the last line `|||`:
|copy screenshot of before here|copy screenshot of after here|

|Before|After|
|-|-|
|||
 -->

## Tests

<!-- Explain how you tested your development -->

- Step 1
- Step 2
- Step ...

## Tested devices

- [ ] Physical
- [ ] Emulator
- OS version(s):

## Checklist

<!-- Depending on the Pull Request content, it can be acceptable if some of the following checkboxes stay unchecked. -->

- [ ] Changes have been tested on an Android device or Android emulator with API 23
- [ ] UI change has been tested on both light and dark themes
- [ ] Accessibility has been taken into account. See https://github.com/vector-im/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
- [ ] Pull request is based on the develop branch
- [ ] Pull request includes a new file under ./changelog.d. See https://github.com/vector-im/element-x-android/blob/develop/CONTRIBUTING.md#changelog
- [ ] Pull request includes screenshots or videos if containing UI changes
- [ ] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
- [ ] You've made a self review of your PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Voice-Messages O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Team: Element X Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants