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

End of Year: Fix occasional crash on returning from share #606

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

ashiagr
Copy link
Contributor

@ashiagr ashiagr commented Nov 23, 2022

📘 Project: #410

Description

This fixes an occasional crash when at the time of sharing, the activity from where stories are launched, is moved to the background and killed due to low memory. On returning from share, the activity is recreated and stories are reloaded, but restarting the paused timer, and trying to update the current story when stories are still loading, crashes the app.

The fix ensures that the timer to switch to the next story doesn't start when stories are still loading. Once stories are loaded, the timer starts again.

Testing Instructions

  1. Enable "Don't keep activities" in device developer options
  2. Run the app and make sure you're logged in to an account with a few items on Listening History
  3. Go to Profile tab and tap "Your Year in Podcasts"
  4. When the stories appear, tap "Share"
  5. Choose WhatsApp which opens a full screen "Send to..." screen and moves the current activity to the background, killing it due to developer settings done in step 1
  6. Go back to the app using back button or gesture
  7. Notice that stories are reloaded and the app doesn't crash

@ashiagr ashiagr requested a review from a team as a code owner November 23, 2022 06:48
Copy link
Member

@geekygecko geekygecko left a comment

Choose a reason for hiding this comment

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

This works well!

@geekygecko geekygecko merged commit f237651 into main Nov 23, 2022
@geekygecko geekygecko deleted the task/410-fix-class-cast-exception branch November 23, 2022 08:14
ashiagr pushed a commit that referenced this pull request Nov 23, 2022
…tion

End of Year: Fix occasional crash on returning from share
@ashiagr ashiagr added this to the 7.27 ❄️ milestone Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants