Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug]: Nightly crashed after changing the wallpaper #26723

Closed
SoftVision-LorandJanos opened this issue Aug 31, 2022 · 3 comments · Fixed by #26735 or nathanmkaya/fenix#108
Closed

[Bug]: Nightly crashed after changing the wallpaper #26723

SoftVision-LorandJanos opened this issue Aug 31, 2022 · 3 comments · Fixed by #26735 or nathanmkaya/fenix#108
Assignees
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. eng:qa:verified QA Verified Feature:Wallpapers S2 Major Functionality/product severely impaired and a satisfactory workaround doesn't exist
Milestone

Comments

@SoftVision-LorandJanos
Copy link

SoftVision-LorandJanos commented Aug 31, 2022

Steps to reproduce

  1. Have a fresh install.
  2. Go to Settings>Homepage>Wallpapers and change the wallpaper.
  3. Close and reopen the app.

Expected behaviour

The app opens without issues with the newly set wallpaper.

Actual behaviour

The app crashes.

Device name

Oppo Find X5

Android version

Android 12

Firefox release type

Firefox Nightly

Firefox version

106.0a1 (2022-08-31)

Device logs

CrashOnLaunchAfterSettingAWappaper.txt

Additional information

  • There was no crash notification.
  • The log was created when reproducing the issue offline.
20220831_080202.mp4

┆Issue is synchronized with this Jira Task

@SoftVision-LorandJanos SoftVision-LorandJanos added 🐞 bug Crashes, Something isn't working, .. b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info S2 Major Functionality/product severely impaired and a satisfactory workaround doesn't exist needs:triage Issue needs triage Feature:Wallpapers labels Aug 31, 2022
@Mugurell
Copy link
Contributor

This seems to follow the recent changes and is easy to reproduce.
Will investigate.

@Mugurell Mugurell self-assigned this Aug 31, 2022
@Mugurell Mugurell removed the needs:triage Issue needs triage label Aug 31, 2022
@Mugurell
Copy link
Contributor

Exception:

android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
   at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:9392)
   at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1757)
  at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.view.View.requestLayout(View.java:25595)
   at android.widget.ImageView.setImageDrawable(ImageView.java:605)
   at androidx.appcompat.widget.AppCompatImageView.setImageDrawable(AppCompatImageView.java:1)
   at android.widget.ImageView.setImageBitmap(ImageView.java:769)
   at androidx.appcompat.widget.AppCompatImageView.setImageBitmap(AppCompatImageView.java:1)
   at org.mozilla.fenix.home.WallpapersObserver.showWallpaper$app_nightly(WallpapersObserver.kt:15)
   at >org.mozilla.fenix.home.WallpapersObserver$observeWallpaperUpdates$1$1.invokeSuspend(WallpapersObserver.kt:1)

It's interesting that this seems intermittent on Nightly and I can't reproduce it locally.
But based on the stacktrace the solution is simple.

Mugurell added a commit to Mugurell/fenix that referenced this issue Aug 31, 2022
Using Dispatchers.IO allowed the observer to react faster to wallpaper state
updates but caused issues with updating the wallpaper in fragment layout.

Using Dispatchers.Main.immediate gives us a bit slower reaction time but still
faster than Dispatchers.Main and allows us to still execute before the fragment
is visible.
Mugurell added a commit to Mugurell/fenix that referenced this issue Aug 31, 2022
… HomeFragment

The observer initialized with a fragment View would outlive the fragment and in
that allow for leaking the entire fragment layout.
@github-actions github-actions bot added the eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged label Aug 31, 2022
@mergify mergify bot closed this as completed in #26735 Sep 1, 2022
mergify bot pushed a commit that referenced this issue Sep 1, 2022
Using Dispatchers.IO allowed the observer to react faster to wallpaper state
updates but caused issues with updating the wallpaper in fragment layout.

Using Dispatchers.Main.immediate gives us a bit slower reaction time but still
faster than Dispatchers.Main and allows us to still execute before the fragment
is visible.
mergify bot pushed a commit that referenced this issue Sep 1, 2022
The observer initialized with a fragment View would outlive the fragment and in
that allow for leaking the entire fragment layout.
@github-actions github-actions bot reopened this Sep 1, 2022
@github-actions github-actions bot added this to the 106 milestone Sep 1, 2022
@github-actions github-actions bot added eng:qa:needed QA Needed and removed eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged labels Sep 1, 2022
@delia-pop
Copy link

Verified as fixed on the latest Nightly 106 updated from main locally. The app no longer crashes on startup when a wallpaper is selected.

screen-20220901-121827_Trim.mp4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info 🐞 bug Crashes, Something isn't working, .. eng:qa:verified QA Verified Feature:Wallpapers S2 Major Functionality/product severely impaired and a satisfactory workaround doesn't exist
Projects
None yet
3 participants