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: app crash when download asset #2092

Merged

Conversation

alexandreferris
Copy link
Contributor

@alexandreferris alexandreferris commented Aug 11, 2023


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

When downloading an asset from the context menu, we were not checking for saving to external permission when user was on Android 9 (API level 28) or lower.

Causes (Optional)

We were not checking permissions.

Solutions

Change downloadAssetExternally to downloadOrFetchAssetAndShowDialog so there is a Dialog handling everything:

  • Checking for device API Level + Permissions
  • Save
  • Open
  • Cancel

And showing a snackbar when successfully saved.

Testing

How to Test

  • Open App
  • Open Conversation
  • Receive an Image or Audio file
  • do not grant file storage permission to app before-hand
  • Long click on Image/Audio file
  • Select Download from the context menu
  • A new Dialog should popup asking if you want to Save/Open/Cancel, if Save then asking permission will be shown

@alexandreferris alexandreferris requested review from a team, typfel, borichellow, MohamadJaara, mchenani and saleniuk and removed request for a team August 11, 2023 15:15
@alexandreferris alexandreferris enabled auto-merge (squash) August 11, 2023 15:24
@github-actions
Copy link
Contributor

Test Results

542 tests   541 ✔️  27s ⏱️
  77 suites      1 💤
  77 files        0

Results for commit 7e4181c.

@github-actions
Copy link
Contributor

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

@AndroidBob
Copy link
Collaborator

Build 1046 succeeded.

The build produced the following APK's:

@alexandreferris alexandreferris merged commit 371fa76 into release/candidate Aug 11, 2023
14 of 15 checks passed
@alexandreferris alexandreferris deleted the fix/app_crash_when_download_asset branch August 11, 2023 15:48
github-actions bot pushed a commit that referenced this pull request Aug 11, 2023
@github-actions github-actions bot mentioned this pull request Aug 11, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants