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

As a user, I want my browser to remember its state on rotating the screen or memory eviction #1994

Closed
colintheshots opened this issue Apr 24, 2019 · 2 comments
Assignees
Labels
eng:task An engineering breakout issue of a user story P1 Current sprint

Comments

@colintheshots
Copy link
Contributor

colintheshots commented Apr 24, 2019

As a user, I want my browser to remember the state of user interface input and state after I rotate the screen between portrait and landscape or when I return to the app after using many other apps so that my browser has has been evicted from memory.

Dependencies (Added by PM and Eng)

  • No dependencies besides Fenix engineering

Next Steps

  • Immediate task: Devote one engineer for 4-5 days to improve the core app architecture. A likely fix is either adding our existing ViewState to ViewModels or to custom retained fragments. Either way, the solution will also need the ability to save and restore instance state.

Acceptance Criteria (Added by PM)

  • I can rotate the screen for most features of the app without losing user input or UI state.
  • I can minimize and restore with the Don't Keep Activities developer setting set active for most features of the app without losing user input or UI state. Alternatively, a better way of testing is to minimize the app and run adb shell am kill org.mozilla.fenix and then launch the app from the recents screen.

┆Issue is synchronized with this Jira Task

@colintheshots colintheshots self-assigned this Apr 24, 2019
@vesta0 vesta0 added eng:task An engineering breakout issue of a user story P1 Current sprint labels Apr 24, 2019
@vesta0 vesta0 added this to the MVP Backlog milestone Apr 24, 2019
@colintheshots
Copy link
Contributor Author

colintheshots commented Apr 25, 2019

I'm considering two options: ViewModels with the alpha Saved State module to provide save/restore functionality. The second option is to reinvent the wheel by designing a custom solution with retained fragments in order to reduce the amount of required boilerplate I'd need to add to our architecture. Retained fragments is how ViewModels work.

@colintheshots
Copy link
Contributor Author

This is mostly fixed. As of PR#2382, the new Fenix architecture handles preserving state on rotation automatically. This is probably sufficient to have a successful MVP.

I'm going to create a new bug to cover the save and restore instance state functionality, which will require careful code design. We don't want save/restore to be fully automatic like our rotation and configuration changes solution is. We want our engineers to think about and specify which state becomes instance state because the OS provides quite limited space for storing state. We wouldn't, for example, want the bookmarks or history screens to store everything into saved instance state if it's likely we might use 1 MB or more of memory. That's because there's a hard limit at 1 MB and we really shouldn't use more than about 100 KB. Instance state is preserved in memory after the Android OS shuts down our app to make space in memory for another app.

Here is the new ticket for handling instance state:
#2418

@sblatz sblatz moved this from In Progress to Done in Fenix Sprint Kanban May 15, 2019
@data-sync-user data-sync-user changed the title As a user, I want my browser to remember its state on rotating the screen or memory eviction FNX2-17577 ⁃ As a user, I want my browser to remember its state on rotating the screen or memory eviction Aug 4, 2020
@data-sync-user data-sync-user changed the title FNX2-17577 ⁃ As a user, I want my browser to remember its state on rotating the screen or memory eviction FNX3-15974 ⁃ As a user, I want my browser to remember its state on rotating the screen or memory eviction Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX3-15974 ⁃ As a user, I want my browser to remember its state on rotating the screen or memory eviction FNX-5385 ⁃ As a user, I want my browser to remember its state on rotating the screen or memory eviction Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX-5385 ⁃ As a user, I want my browser to remember its state on rotating the screen or memory eviction As a user, I want my browser to remember its state on rotating the screen or memory eviction May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
eng:task An engineering breakout issue of a user story P1 Current sprint
Projects
None yet
Development

No branches or pull requests

4 participants