firefox-ios
firefox-ios copied to clipboard
[Experiment] History highlights disappear if the app is brought back from background after more than 3 seconds
Preconditions
- Have the Firefox Release 104 (14776) installed through TestFlight.
- Be enrolled in the Firefox iOS Search Highlights experiment.
- Have a few sites visited so that they can show up as History suggestions.
Steps to reproduce
- Open the browser from prerequisites.
- Write a string that would result in History suggestions being displayed.
- Send the app to background and wait at least 3 seconds.
- Put the app back into foreground and observe the page.
Expected behavior
- At most 3 History search results are still displayed in the awesome bar suggestions.
Actual behavior
- History search results are displayed for a fraction of a second and then disappear.
Device & build information
- Device: iPhone 11 - iOS 15.5
- Device: iPhone XR - iOS 15.3.1
- Build version: Firefox Release 104 (14776), Firefox Release 103.0 (13910), Firefox Release 102.0 (13909)
Notes
- Bookmarks, Open Tabs, and Remote tabs are still displayed when doing the scenario.
- The History search suggestions are redisplayed if the awesomebar is tapped.
- The issue is not reproducible if the app spends less than 3 seconds in background.
- The issue is not reproducible on the control branch, in this case History related results are still displayed after the app is brought back into foreground.
Attachments:
https://user-images.githubusercontent.com/18304511/182402366-5a547b01-3b89-4a93-9e9b-d8001cca9386.mp4
┆Issue is synchronized with this Jira Task
I've noticed this happens outside of experiments as well.
Search highlights are getting reloaded because when the app goes into the background, BVC's traitCollectionDidChange
is called (multiple times..?????). I think this happens because the system takes snapshots for both theme styles when going into the background.
This sets the theme value again, which then posts a theme change notification. And from there observers react. It finds its way into SearchVC's applyTheme method, which has a reload for searchHighlights.
What you're seeing is search highlights getting reloaded with zero results. Even though the search query is correctly passed in, somewhere along the lines of the deferred chain we lose these results.
What we can do is somehow guard against calling reload logic particularly for this case that's causing the bug. I don't recommend this. it's a hacky fix at best that can cause other issues.
The other option is fixing this bug as part of a LegacyThemeManager --> Revamped themeing system. We won't have an applyTheme, so we won't reload. And avoiding that reload will prevent a search highlights result set of zero.
@dnarcese
➤ Sorin Paraipan commented:
Hey there, I checked out Build 104 (this was the oldest that I found on testflight) and found that the bug was present. However, when I tested the latest build, I couldn't reproduce the issue anymore. As far as I'm concerned, it looks like this bug has been fixed and can be closed. The QA team can also give it a final check.
@SoftVision-CiprianMuresan could you double check if this is still reproducible when you get the chance?
Hello, @SoftVision-CiprianMuresan can you please check if this is still reproducible or can we close it?