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

fix: recreate cache directories in case cache is cleared [WPB-7368] 🍒 #3016

Merged

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented May 20, 2024

BugWPB-7368 [Android] Playstore crash - Resample Image and File handling

This PR was manually cherry-picked based on the following PR (automatic cherry pick failed):

Original PR description:


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

We get multiple crashes when accessing cache files (ENOENT errors) which potentially suggest that the cache is fully cleared and the app cannot find needed directories for the given user in cache to create a temporary file for that user.

Solutions

Refactor code to have only single source of temporary file paths - kaliumFileSystem.tempFilePath, and use updated kalium version where cache directories are being recreated when getting a temporary cache file path in case cache is cleared.

Dependencies (Optional)

Needs releases with:

Testing

How to Test

Open the app, clear app cache and try to send or download asset.

Notes (Optional)

Specify here any other facts that you think are important for this issue.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link
Contributor

github-actions bot commented May 20, 2024

Test Results

930 tests  ±0   930 ✅ ±0   13m 56s ⏱️ +27s
124 suites ±0     0 💤 ±0 
124 files   ±0     0 ❌ ±0 

Results for commit 8675e84. ± Comparison against base commit d26b742.

♻️ This comment has been updated with latest results.

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4820 succeeded.

The build produced the following APK's:

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 44.26%. Comparing base (d26b742) to head (8675e84).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3016   +/-   ##
========================================
  Coverage    44.25%   44.26%           
========================================
  Files          448      448           
  Lines        14519    14517    -2     
  Branches      2495     2493    -2     
========================================
  Hits          6426     6426           
+ Misses        7391     7388    -3     
- Partials       702      703    +1     
Files Coverage Δ
...ome/conversations/usecase/HandleUriAssetUseCase.kt 96.96% <100.00%> (ø)
...id/ui/sharing/ImportMediaAuthenticatedViewModel.kt 0.00% <0.00%> (ø)
.../conversations/sendmessage/SendMessageViewModel.kt 84.70% <50.00%> (ø)
...c/main/kotlin/com/wire/android/util/FileManager.kt 11.11% <0.00%> (+0.39%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d26b742...8675e84. Read the comment docs.

@saleniuk saleniuk requested review from a team, typfel, yamilmedina, alexandreferris, vitorhugods and mchenani and removed request for a team May 21, 2024 07:09
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4917 succeeded.

The build produced the following APK's:

@MohamadJaara MohamadJaara added this pull request to the merge queue May 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 22, 2024
saleniuk added 3 commits May 23, 2024 08:55
…hen-cleared-cherry-pick' into fix/recreate-cache-directories-when-cleared-cherry-pick
@saleniuk saleniuk enabled auto-merge May 23, 2024 06:56
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@saleniuk saleniuk added this pull request to the merge queue May 23, 2024
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4926 failed.

Merged via the queue into develop with commit 8f8b582 May 23, 2024
13 of 14 checks passed
@saleniuk saleniuk deleted the fix/recreate-cache-directories-when-cleared-cherry-pick branch May 23, 2024 07:54
@echoes-hq echoes-hq bot added the echoes: unplanned Any work item that isn’t part of the product or technical roadmap. label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: unplanned Any work item that isn’t part of the product or technical roadmap. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants