Page MenuHomePhabricator

On This Day widget takes user to Russian(?) version of the page
Closed, ResolvedPublic

Description

https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom;TicketID=11506634

I noticed a bug upon updating to the latest release, the ‘on this day’ Home Screen widget on iOS 14 displays in English. When you tap on it to go into the app however it brings you to the Russian language version of the page (or rather, what I believe to be Russian, it is with Cyrillic characters and I unfortunately am not familiar with the language). Simply tapping out of that page brings you to the English language home page of the app as expected. My language is set to English in the app.

https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom;TicketID=11506422

There’s also a bug I’d like to report. I’m on the latest beta version (just moved over from the App Store version!) and tapping anywhere on the widget except for one of the article cards opens the Russian “On this day” screen, although I only have English and Spanish Wikipedia enabled. (See attached screen recording)

Event Timeline

Here's some test step weirdness I've noticed when testing with multiple languages:

  1. I had English as primary, German as secondary (+ a few other languages further down). On this day widget shows English and correctly deep links to English On This Day screen.
  2. Adjusted German to be primary. (Maybe refreshed Explore feed at this point). Widget still shows English. Tapping English widget takes you German On This Day.
  3. Deleted German language in Settings. Widget is still English. Tapping English widget takes you German On This Day.

If we can pass a content group object ID to the deep link, that might be the best way to keep these matching. We should also confirm a widget reload attempts as soon as languages are adjusted, and see what is causing English to remain in the widget even when you move another language to primary.

Also, test this functionality in the Top Read widget as well.

Can confirm that the video is Russia's on this day for yesterday (when video was taken): https://ru.wikipedia.org/api/rest_v1/feed/onthisday/events/09/16

So the question becomes, why are we pulling in the Russian feed?

PR for main part is merged: https://github.com/wikimedia/wikipedia-ios/pull/3701

Now working on the language funkiness Toni noted.

Progress made: If this is threaded, it's a race condition. If it's not threaded, we're just pulling the data before we're setting the new language. It doesn't take two moves to get the language to update - it's always using the prior language.

To reproduce: Have three languages. If A is currently in use, switch to B, then switch to C, then check the widgets - they will show language B.

It's possibly a context issue. When debugging, you can see the new language being updated appropriately, then trying to get the language from the widget, and there it shows as the outdated language.

Thoughts:

  • I tried calling updateAllWidgets when the WMFAppLanguageDidChange notification fired. That also didn't help.
  • We're using the feedImportContext when updating the feed... not sure if that is related.

Is there some reason the DataStore would return out of date information when the widgets are reloading? That seems to be what is happening here.

LGoto triaged this task as Medium priority.Sep 21 2020, 6:44 PM
LGoto moved this task from Needs Triage to Bug Backlog on the Wikipedia-iOS-App-Backlog board.