Opening and closing Synced Tabs crashes

Open
#1,217 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, kotlin
Domain
mobile

Research direction

Start with SyncedTabsLayout.kt:72 and trace the refresh path through DefaultController.kt:31 and DefaultPresenter.kt:92, using the supplied CalledFromWrongThreadException stack trace. Reproduce the quick open-and-close flow on Android 10 or inspect the authentication callback path. Done means opening and closing Synced Tabs no longer crashes.

Written by the indexing model from the issue text.

Description

🐞 bug
Steps to reproduce
  1. Open and close the Synced Tabs view quickly before.
Expected behavior
  • Don't crash.
Actual behavior
  • 💥
Device information
  • Android device: Android 10, Pixel 4
  • Reference Browser version: Nightly, 2020-06-02
25cee985-b1d9-4180-8123-24a986715394
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
 * Socorro: https://crash-stats.mozilla.org/report/index/bp-b162d95d-b87d-419f-8f35-e91ce0200602
 * Sentry: <No URL>
----
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
	at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:8372)
	at android.view.ViewRootImpl.focusableViewAvailable(ViewRootImpl.java:4273)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:940)
	at android.view.View.setFlags(View.java:15732)
	at android.view.View.setVisibility(View.java:11372)
	at org.mozilla.reference.browser.tabs.synced.SyncedTabsLayout.startLoading(SyncedTabsLayout.kt:72)
	at mozilla.components.feature.syncedtabs.controller.DefaultController.refreshSyncedTabs(DefaultController.kt:31)
	at mozilla.components.feature.syncedtabs.presenter.DefaultPresenter$SyncedTabsAccountObserver.onAuthenticated(DefaultPresenter.kt:92)
	at mozilla.components.service.fxa.manager.FxaAccountManager$postAuthenticated$3.invoke(FxaAccountManager.kt:960)
	at mozilla.components.service.fxa.manager.FxaAccountManager$postAuthenticated$3.invoke(FxaAccountManager.kt:150)
	at mozilla.components.support.base.observer.ObserverRegistry.notifyObservers(ObserverRegistry.kt:137)
	at mozilla.components.service.fxa.manager.FxaAccountManager.notifyObservers(Unknown Source:7)
	at mozilla.components.service.fxa.manager.FxaAccountManager.postAuthenticated(FxaAccountManager.kt:960)
	at mozilla.components.service.fxa.manager.FxaAccountManager$postAuthenticated$1.invokeSuspend(Unknown Source:12)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:919)

Dominant language
Kotlin
Stars
668
Forks
198
Avg merge
8h 47m
Merged PRs (30d)
53

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla-mobile/reference-browser

All issues in mozilla-mobile/reference-browser

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.