Page MenuHomePhabricator

Improve navigation stack restoration load times
Closed, ResolvedPublic

Description

Xcode indicates an area of hang time when restoring the user's navigation stack.

I have reproduced large load times due to a deep navigation stack, particularly if I am able to trigger multiple layers of deep navigation stacks. I can get into this state by drilling down a large rabbit hole, then saving an article. From the reading list toast prompt, open a reading list modal and choose an article that is already saved. This then allows me to then build an additional rabbit hole within the modal's navigation stack. I can keep going to a 3rd, 4th, 5th modal navigation stacks on top of this by repeating these steps. Something about these stacked rabbit holes really causes the app state restoration code to hang, and after it finally launches I am even able to tap the top search button on the article view, which sends me to a search screen with a missing search textfield (this is similar to another recently reported bug).

This likely started getting worse with T323473, where we were no longer cleaning out their navigation state and giving them a fresh start each day.

I suggest doing a couple of things:

  1. Do not allow pushing an article from the right within the reading list modal.
    • Instead I will first dismiss the reading list modal, then push on the article the tapped from the right.
  2. Simplify navigation state restoration.
    • Can we only restore the last article they read, pushed onto the root navigation controller, instead of the entire rabbit hole and any presented screen rabbit holes?

QA Steps

Upgrade test

There is a long video in the iOS Slack channel reproducing this state. Get into this state on the App Store 7.2.2 release, then update to a version that has this fix in it. Confirm there is no more loading time hang, and only the user's last article they saw is restored.

Reading List Detail Modal Navigation Test

  1. Go to an article, tap saved button in bottom toolbar
  2. In the toast, tap to save to a reading list
  3. In the next toast, tap to view reading list
  4. On reading list detail modal screen, tap an article. Confirm modal dismisses and article is pushed onto navigation stack beneath.

Simplify state restoration test

  1. Create a simple rabbit hole from tapping on the Explore feed featured article card. Then background and terminate via the app switcher. Relaunch the app, confirm your last article is restored. Confirm tapping "Back" takes you back to the home screen (i.e. no other parts of the stack are restored).
  2. Create a rabbit hole in a modal from tapping on the Explore feed > Top read card > All top read articles. Background and terminate via the app switcher. Relaunch the app, confirm your last article is restored. Confirm tapping "Back" takes you back to the home screen.
  3. Create another rabbit hole from app Settings > Your talk page. If possible, try to reach an article from this flow. Terminate the app and confirm only the article restores like the previous test steps.
  4. Create a navigation stack where there is no article view. Confirm it launches on the home screen.

Event Timeline

Tsevener triaged this task as Medium priority.
Tsevener updated the task description. (Show Details)

Can we only restore the last article they read, pushed onto the root navigation controller, instead of the entire rabbit hole and any presented screen rabbit holes?

I pushed this proposition up into the TestFlight Experimental build 7.3.0 (23). @cmadeo @OTichonova Let me know how this feels - this way we are still able to keep indefinite article restoration asked for in T323473, but just limited their most recent article to reduce and simplify load times.

LGoto raised the priority of this task from Medium to High.May 23 2023, 6:28 PM
LGoto moved this task from Needs Triage to Engineering Backlog on the Wikipedia-iOS-App-Backlog board.

Update from iOS team planning:

General thoughts are that only restoring their last read article, otherwise taking them home to the Explore feed is acceptable. Design and Product will spin off other tickets on improving this experience in the future.

Since we confirmed how this should work in planning and there isn't additional UI work to see, I don't think we need specific design review for this one. Moving into Needs Code Review.

This fix is in TestFlight 7.3.0 (2242).