Page MenuHomePhabricator

[ZNUNY] Keyboard opens on Setting tab when brought from background
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):
From the ticket
https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom;TicketID=12205763#

Can you attach a video of what you're seeing?

Maybe later. The issue only appears after the app has been inactive for quite some time.
Simply removing it from memory does not trigger the problem. Reading the code on GitHub
makes me guess that the interval is > 5 hours.

It would be particularly helpful to see where you were in the app before terminating the

app and relaunching to get into this state.

Most likely viewing an article. Either that or the search view.

However, you say "terminating" the app — I don't terminate it, I simply put it in the
background and don't return to it for a day. It could very well have remained in memory.
Also, you say "relaunching to get into this state" — no, I relaunch (I.e. kill and launch
in close succession) to work around this problem.

Also can you tell me what your app settings are for these?

  1. Wikipedia app Settings > Explore feed > Bottom "Explore tab" toggle - is it On or

Off?

The tab is off — the entire feed is off.

  1. Wikipedia app Settings > Search > "Open app on Search tab" toggle - is it On of Off?

On.

So the situation seems to be that the Settings tab is the first tab in the tab bar and
after a significant timeout in background is selected (in a restoration attempt of some
kind?), but a non visible search field is made first responder even though the switch to
the search tab has failed.

What happens?:
*The keyboard opens on the settings view, blocking the tab bar when the app is brought from the background after a long time.

What should have happened instead?:

  • No keyboard should appear.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
6.9.1 (1930) iPhone 15.4

Event Timeline

LGoto triaged this task as Low priority.Jun 21 2022, 6:17 PM
LGoto moved this task from Needs Triage to Bug Backlog on the Wikipedia-iOS-App-Backlog board.

I looked into this, and it seems like some race condition with the last few lines of WMFAppViewController's configureTabController:

if (shouldOpenAppOnSearchTab && self.selectedIndex != WMFAppTabTypeSearch) {
    [self setSelectedIndex:WMFAppTabTypeSearch];
    [[self searchViewController] makeSearchBarBecomeFirstResponder];
} else if (self.selectedIndex != WMFAppTabTypeMain) {
    [self setSelectedIndex:WMFAppTabTypeMain];
}

I was able to replicate this issue once when testing - I was turning the setting for whether to show the explore feed and the setting for whether to start on the search VC off and on a bunch. Though I triggered the bug via that route once, I wasn't able to find consistent replication steps.

My initial hunch was wrong: shouldShowExploreScreenOnLaunch didn't consider whether the user wanted to always launch into the search tab - so it was opening to Search, then switching to Settings.

To replicate bug, set WMFTimeBeforeShowingExploreScreenOnLaunch to 10 seconds.

ABorbaWMF subscribed.

Appears to be fixed on 6.9.3 (1948)

Please note I was using the following steps to reproduce this one. Please let me know if I should try anything else.

Steps:

  1. Turn off Explore feed
  2. Do some searches and view some articles
  3. Tap on the settings tab
  4. Background the Wikipedia app for a while
  5. Tap on the app icon to reopen it or tap it from the backgrounded apps

Note - I tried it on a phone and a tablet

JMinor claimed this task.