Page MenuHomePhabricator

Investigate the root cause of the 2019 fundraising banner still showing in the app after the end date before implementing the 2020 banner
Open, MediumPublicSpike

Description

The workaround was implemented with T247554 but we need to figure out the root cause before running the 2020 banner.

Use cases already tested (might be worth re-testing anyway):

  • End date passes normally: On the next explore feed refresh (either through pull to refresh or schedule) the announcement is marked isVisible = false
  • User disables the explore feed: The app still refreshes the explore feed content so the announcement is marked isVisible = false
  • User is offline after the end date passes: The app still refreshes the explore feed content so the announcement is marked isVisible = false

If somehow the explore feed content wasn't refreshed through WMFExploreFeedContentController, it could be the root cause, but I couldn't find a case where the explore feed wasn't refreshed.

Event Timeline

JoeWalsh created this task.Mar 18 2020, 1:57 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 18 2020, 1:57 PM
LGoto triaged this task as Medium priority.Mar 23 2020, 6:38 PM
LGoto moved this task from Needs Triage to Bug Backlog on the Wikipedia-iOS-App-Backlog board.
Restricted Application changed the subtype of this task from "Task" to "Spike". · View Herald TranscriptNov 3 2020, 7:17 PM
Tsevener claimed this task.Tue, Jan 12, 4:03 PM

I may have found a way to trigger this bug. Here are the things I've tried on the AppStore build:

  1. Map locally via proxy some announcements with fundraising that ends on 1/20/2021. Go to 2nd launch to confirm it's fetched. Terminate, stop mapping locally, change device date to Feb 2021. Launch again, fundraising announcement correctly doesn't show.
  2. Map locally via proxy some announcements with fundraising that ends on 1/20/2021. Go to 2nd launch to confirm it's fetched. Save an article. Terminate, stop mapping locally, change device date to Feb 2021. Enter airplane mode. Launch again, go to saved article. Fundraising announcement correctly doesn't show.
  3. Map locally via proxy some announcements with fundraising that ends on 1/20/2021. Go to 2nd launch to confirm it's fetched. Terminate, stop mapping locally, change device date to Feb 2021. Relaunch the app via an article deeplink. Fundraising announcement incorrectly shows on article user deep linked to.
  4. Map locally via proxy some announcements with fundraising that ends in a few minutes. Go to 2nd launch to confirm it's fetched. Background until those few minutes have elapsed. Foreground and tap an article. Fundraising announcement incorrectly shows on article.

I doubt #4 would be the cause of still seeing the announcement for months, but whatever causes #3 could be since that happens from a terminated state with a device date bumped to February. This is by no means comprehensive but gives us something to test our fix against.

I also found a separate reason for why our survey modal might still show for users. Survey announcement managed objects are deleted immediately from the database after the endpoint is fetched and processed, so I didn't think it was a case of database objects hanging around longer than expected. However, it seems that the announcement payload itself is cached, despite our explicit request in the fetcher for it to ignore the cache. This is a bug likely introduced with the mobile-html release, where we added caching hooks within many of the data fetching methods in Session.swift. This still wouldn't cause bugs because we explicitly check the end date shortly before displaying the survey modal in ArticleViewController+SurveyAnnouncements.swift, however in looking at the history of our wikifeeds updates, the endDate was at one point 2021/02/01. So if that's the version that is cached, and a user opens the app (they seem to need to be in offline mode) and visit an article in the list, the prompt still shows.

Repro steps: Map locally via proxy some announcements with a survey that ends on 2/01/2021. Upon first launch, save an article in the campaign list. Go to 2nd launch to confirm local announcements are fetched. Terminate, stop mapping locally in proxy, and enter offline mode on device. Launch again and go to your saved article.

Expected: Survey modal should NOT show because the article should not be leaning on cache in offline mode, thus pulling the 02/01/2021 end date campaign.
Actual: Survey modal shows after displayDelay from announcement has elapsed.

If this is the root cause, these should hopefully dry up after Februrary. However it would be good to fix the caching bug regardless.

Note for QA: this fix is in the TestFlight build 6.7.4 (1791).