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: Crash when uploading file #2938

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

mebarbosa
Copy link
Contributor

@mebarbosa mebarbosa commented Sep 26, 2024

Description

  • This is an attempt to fix the crash when the user uploads a file from files screen. After analyzing the code and googling about it I had 3 hypothesis:
  1. This issue is caused a generic error when uploading a file. This generic error throws an exception that we are not catching inside the coroutine
  2. The URI that we are trying to upload is invalid and we are not checking it. This could also be caused if the user removed or moved the file path after selecting this one to be downloaded. I was able to reproduce a crash with this scenario
  3. I thought that it could be related to permissions because this issue is happening mostly on SDK 34, but since we are not trying to access others apps files I would say that we are good in terms of permission and we don't need to do anything else. See this ref and this ref

So, for this PR I am addressing the first two hypothesis and also added tracks for both scenarios so we can check them in terms of data

Fixes #2285

Testing Instructions

Happy Path

  1. Go to Profile -> Files
  2. Upload file
  3. ✅ Ensure you can upload a file without any error

Error Path

  1. Go to Profile -> Files
  2. Tap o + button to upload a file
  3. Select the file
  4. You should see the screen to change the file name and colors
  5. Put Pocket Casts app in background and delete this file
  6. Go back to Pocket Casts app and tap to save
  7. ✅ Ensure you don't get any crash and see the dialog with error message

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@mebarbosa mebarbosa added [Type] Bug Not functioning as intended. [Area] User Files The Files section in the Profile tab labels Sep 26, 2024
@mebarbosa mebarbosa added this to the 7.74 milestone Sep 26, 2024
@mebarbosa mebarbosa requested a review from a team as a code owner September 26, 2024 16:29
@mebarbosa mebarbosa requested review from ashiagr and removed request for a team September 26, 2024 16:29
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 26, 2024

📲 You can test the changes from this Pull Request in 📱 Mobile by scanning the QR code below to install the corresponding build.
App Name 📱 Mobile
Build TypedebugProd
Commitf5d2a78
Direct Downloadpocketcasts-app-prototype-build-pr2938-f5d2a78.apk
📲 You can test the changes from this Pull Request in 🚗 Automotive by scanning the QR code below to install the corresponding build.
App Name 🚗 Automotive
Build TypedebugProd
Commitf5d2a78
Direct Downloadpocketcasts-automotive-prototype-build-pr2938-f5d2a78.apk
📲 You can test the changes from this Pull Request in ⌚ Wear by scanning the QR code below to install the corresponding build.
App Name ⌚ Wear
Build TypedebugProd
Commitf5d2a78
Direct Downloadpocketcasts-wear-prototype-build-pr2938-f5d2a78.apk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Area] User Files The Files section in the Profile tab [Type] Bug Not functioning as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Files: Crashing when uploading files
2 participants