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

Always ensure media temp dir exists #1790

Merged
merged 3 commits into from
Nov 13, 2023
Merged

Conversation

julioromano
Copy link

@julioromano julioromano commented Nov 13, 2023

Type of change

  • Feature
  • 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

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

`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
Copy link
Contributor

github-actions bot commented Nov 13, 2023

📱 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/wM8eER

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (14be887) 63.40% compared to head (27bd019) 63.40%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1790      +/-   ##
===========================================
- Coverage    63.40%   63.40%   -0.01%     
===========================================
  Files         1292     1292              
  Lines        33568    33569       +1     
  Branches      6981     6982       +1     
===========================================
  Hits         21284    21284              
- Misses        9088     9089       +1     
  Partials      3196     3196              
Files Coverage Δ
...roid/libraries/mediaplayer/impl/MediaPlayerImpl.kt 0.00% <0.00%> (ø)
...d/features/rageshake/impl/logs/VectorFileLogger.kt 1.47% <0.00%> (-0.03%) ⬇️

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

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

@julioromano
Copy link
Author

Copy link

sonarcloud bot commented Nov 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks!

@julioromano julioromano merged commit 58e05d1 into develop Nov 13, 2023
15 of 17 checks passed
@julioromano julioromano deleted the julioromano/fix_1788 branch November 13, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clearing the cache prevents voice messages being played until app is restarted
2 participants