Page MenuHomePhabricator

[BUG] Error occured when switching between Chinese variants
Closed, ResolvedPublicBUG REPORT

Description

This issue happened on both current production and alpha.

Steps to reproduce

  1. Go to [Internet_of_Things] article.
  2. Click on "Other languages" and switch to "Traditional Chinese"
  3. Click on "Other languages" again to switch to "Simplified Chinese"

Demo: https://youtu.be/EEUbsffazbw

Expected

Able to read 物联网 after switched to Simplified Chinese

Actual

An error occured

Stacktrace (current master devDebug)

2018-10-12 16:49:29.693 11679-11945/org.wikipedia.dev D/OkHttp: <-- 200 https://zh.wikipedia.org/w/api.php?format=json&formatversion=2&action=mobileview&prop=text|sections|languagecount|thumb|image|id|namespace|revision|description|lastmodified|normalizedtitle|displaytitle|protection|editable|pageprops&pageprops=wikibase_item&sections=0&sectionprop=toclevel|line|anchor&noheadings=&page=IoT%E6%8A%80%E8%A1%93&thumbwidth=640&uselang=zh-hans (205ms, unknown-length body)
2018-10-12 16:49:29.695 11679-11679/org.wikipedia.dev E/org.wikipedia.page.PageFragmentLoadState$3: onFailure():358: PageLead error: 
  org.wikipedia.dataclient.mwapi.MwException: The page you specified doesn't exist.
      at org.wikipedia.dataclient.mwapi.MwResponse.postProcess(MwResponse.java:28)
      at org.wikipedia.json.PostProcessingTypeAdapter$1.read(PostProcessingTypeAdapter.java:28)
      at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:39)
      at retrofit2.converter.gson.GsonResponseBodyConverter.convert(GsonResponseBodyConverter.java:27)
      at retrofit2.ServiceMethod.toResponse(ServiceMethod.java:122)
      at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:217)
      at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:116)
      at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
      at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
      at java.lang.Thread.run(Thread.java:764)

Event Timeline

@bearND @Mholloway

In this case, we can navigate to the Traditional Chinese version of the Internet of things from the EN wiki Internet_of_things

The article title in Traditional Chinese is IoT技術, but the URL to request the article is 物联网 instead of IoT技術

If the app wants to request the Traditional Chinese version of the Internet of things, it should send 物联网 as the value of page

https://zh.wikipedia.org/w/api.php?format=json&formatversion=2&action=mobileview&prop=text|sections|languagecount|thumb|image|id|namespace|revision|description|lastmodified|normalizedtitle|displaytitle|protection|editable|pageprops&pageprops=wikibase_item&sections=0&sectionprop=toclevel|line|anchor&noheadings=&page=物联网&thumbwidth=640&uselang=zh-hant

In the response, the displaytitle shows a "converted" title IoT技術, but does not include the converted titles or redirected title, which will cause the following errors when the app trying to get the other information by the displaytitle.

If we are using 物聯網 to request the page, it will show us the converted titles correctly.

Summary

Send page=IoT技術 => returns Error
Send page=物联网 with uselang=zh-hant => returns displaytitle in IoT技術
Send page=物聯網 with uselang=zh-hant => returns displaytitle in IoT技術 and converted attribute with converted titles.

Question

Would it be possible to add values to converted titles if the displaytitle does not match the value to give to page? or, do you have any suggestion for this case?

Change 467848 had a related patch set uploaded (by Cooltey; owner: Cooltey):
[apps/android/wikipedia@master] [WIP] Fix: Error occured when switching between Chinese variants

https://gerrit.wikimedia.org/r/467848

Change 467848 merged by jenkins-bot:
[apps/android/wikipedia@master] Fix: Error occured when switching between Chinese variants

https://gerrit.wikimedia.org/r/467848

I'm glad you found a solution for this. But CC'ing Reading Infrastructure for more visibility.

Restricted Application changed the subtype of this task from "Task" to "Bug Report". · View Herald TranscriptNov 14 2021, 12:06 AM