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 UI crash when user navigates away before the download dialog appears #11621

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

elvakang
Copy link

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Fixed a UI crash that occurs when a user navigates away before the download dialog appears.
  • The crash was caused by an IllegalStateException when showing DownloadDialog after the fragment's state was saved.
  • Implemented checks to ensure the fragment is added and its state is not saved before displaying the dialog, preventing unsafe transactions and avoiding crashes.

Before/After Screenshots/Screen Record

  • Before:
Screen_recording_20241019_234611.mp4
  • After:
Screen_recording_20241020_000319.mp4

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@github-actions github-actions bot added the size/small PRs with less than 50 changed lines label Oct 19, 2024
@ShareASmile ShareASmile added the bug Issue is related to a bug label Oct 20, 2024
@TobiGr
Copy link
Member

TobiGr commented Oct 23, 2024

Thank you. No crash is better than a crash. The solution is not perfect because the dialog is just not shown. But I am ok with that. We should however document this problem. Please add a comment explaining why the check is performed as it is and rebase your PR

@elvakang
Copy link
Author

Thank you. No crash is better than a crash. The solution is not perfect because the dialog is just not shown. But I am ok with that. We should however document this problem. Please add a comment explaining why the check is performed as it is and rebase your PR

I've added the comment explaining the checks in code and rebased the branch. Let me know if there's anything else needed.

Copy link

sonarcloud bot commented Oct 27, 2024

@TobiGr
Copy link
Member

TobiGr commented Oct 27, 2024

Leaving this open for a second review.

Please let me know if you are an ANU student for internal statistics and because I am writing my master thesis about open source contributions as part of learning computer science and computer science education at university.

@elvakang
Copy link
Author

Leaving this open for a second review.

Please let me know if you are an ANU student for internal statistics and because I am writing my master thesis about open source contributions as part of learning computer science and computer science education at university.

Yes, I am an ANU student, and this PR is part of my coursework on open source contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug size/small PRs with less than 50 changed lines
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

UI Crash When Navigating to Channel from Download Prompt
4 participants