Page MenuHomePhabricator

Settings - Open app on Search does nothing
Closed, ResolvedPublicBUG REPORT


How many times were you able to reproduce it?

Every time

Steps to reproduce

  1. Go to Settings
  2. Toggle "Open app on Search" to ON
  3. Terminate app
  4. Relaunch

Expected results

App lands on search tab

Actual results

App still lands on Explore tab

Environments observed

App version: 6.3.0
OS versions: 12.2
Device model: iPhone X
Device language: EN

Event Timeline

Tsevener created this task.Aug 1 2019, 1:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 1 2019, 1:56 AM
LGoto triaged this task as High priority.Aug 5 2019, 7:03 PM

It looks like the selectedIndex of the main tab bar controller is getting set to the correct index for the search view controller when the app launches, but immediately afterwards the app attempts to restore the navigation state which sets the selectedIndex back to whatever it was the last time the app was backgrounded.

If I modify shouldRestoreNavigationStackOnResumeAfterBecomingActive: in AppDelegate.m to always return NO then I can no longer reproduce the issue, so presumably it would also work correctly if you just wait until the cutoff time to restore the nav state (which appears to be 5 hours) has passed. In light of that, it's not clear to me whether this is actually a bug. Is the expected behavior here for the "open on search" setting to override the standard behavior regarding restoration of the nav state?

@Eholshouser Thanks for looking into this. I'd expect the "Open app on Search" setting to override state restoration. cc @JMinor

Cool, I think it should be a simple fix if that's the case.

@JMinor, @cmadeo

If "Open app on Search" is on and I leave the app with a stack of articles pushed from Search, should I have the stack restored or not (assuming it happens before the cutoff date)?

Open app on Search" is on
Leaving the app in this state: Search > Panda > Dog > Cat

Before the cutoff date, opening the app to

a) Search
b) Search > Panda > Dog > Cat

JMinor added a comment.Aug 9 2019, 5:57 PM

Ideally (b) -- that is the stack should be restored when returing after search before the cutoff. However if this is significant re-work for the state restoration it is not absolutely vital.

@JMinor it's a bit of a re-work. I think it's fine to merge the simpler solution to solve this ticket then follow up later with a more nuanced implementation like option b

JMinor added a comment.Aug 9 2019, 6:17 PM

Per IM convo, lets do the simple solution of returning to search without the stack for the quick win, and we can revisit final behavior in 6.4

ABorbaWMF added a subscriber: ABorbaWMF.

Looks good to me on 6.3.2 (1659)

JMinor closed this task as Resolved.Tue, Aug 27, 8:44 PM