Open Bug 1810169 Opened 2 years ago Updated 2 years ago

BaseBrowserFragment uses fixed selected session to initialize UI

Categories

(Firefox for Android :: General, task, P3)

All
Android
task

Tracking

()

People

(Reporter: csadilek, Unassigned)

Details

From github: https://github.com/mozilla-mobile/fenix/issues/14215.

https://github.com/mozilla-mobile/fenix/blob/master/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt#L211-L638

protected open fun initializeUI(view: View): Session? {
  return getSessionById()?.also { session ->
    // ...
  }
}

This code is problematic. getSessionById() returns the fixed session (e.g. in a custom tab) or the selected tab (sessionManager.selectedSession). The selected tab can change during the lifetime of the fragment and so we shouldn't use it to initialize the UI once.

Luckily there's only one place where the session parameter is used. So this may not be a big project to refactor.

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Flags: needinfo?(cpeterson)
Severity: -- → N/A
Type: defect → task
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.