One of the consequences of {T328036} is that the KaiOS app can't load article contents anymore. We can see it on our end from the drop in pageviews:
{F37397523}
If/when the app is updated to switch from `/page/mobile-sections/` endpoint to `/page/mobile-html/` we will also need to update the code in the pipeline which detects which web requests made by the KaiOS app are pageviewsThe app's codebase has been updated from using `/page/mobile-sections/` endpoint to `/page/mobile-html/`, although that new version has not been released to users yet. ItThe pipeline currently looks for requests made to the decommissioned endpoint:
```lang=java
final boolean isKAiOSPageview = Utilities.stringContains(uriPath, PageviewDefinition.URI_PATH_REST_API)
&& Utilities.stringContains(uriPath, "/page/mobile-sections/");
```
https://gerrit.wikimedia.org/r/plugins/gitiles/analytics/refinery/source/+/3e6c6fb1917b42fc75e418550746858246c682b0/refinery-core/src/main/java/org/wikimedia/analytics/refinery/core/PageviewDefinition.java#185
And looking at https://github.com/wikimedia/wikipedia-kaios it does not set `pageview=1` in the X-Analytics header like the other Wikipedia apps do ([[ https://github.com/wikimedia/apps-android-wikipedia/blob/f78873442eb8eb750fa2677306157339d160dd93/app/src/main/java/org/wikipedia/dataclient/okhttp/OkHttpWebViewClient.kt#L119 | Android ]], [[ https://github.com/wikimedia/wikipedia-ios/blob/de4ac95a91a1000a2e8c5687d6d8d10cc1f94d38/Wikipedia/Code/ArticleFetcher.swift#L343 | iOS ]]; per T256507).
Ideally, KaiOS app wshould use the same method to avoid disruption by switching endpoints. The change should probably happen in both places:
- In pageview definition check(set `pageview=1` X-Analytics header for requests made to `mobile-html` endpoint
- In KaiOS app set `pageview=1` X-Analytics header to future-proof pageview detection
It's unclear if the app has already been updated but judging by the web request data it does not appear to have been as of August 11, 2023:
```lang=sql
SELECT
regexp_extract(uri_path, '/api/rest_v1/page/(mobile-([a-z]+))/.*', 1) AS endpoint,
http_status,
COUNT(1) AS request_count
FROM webrequest
WHERE webrequest_source = 'text'
AND year = 2023 AND month = 8 AND day = 11
AND regexp_like(user_agent, 'WikipediaApp')
AND user_agent_map['os_family'] = 'KaiOS'
AND regexp_like(uri_path, '/api/rest_v1/page/mobile-')
GROUP BY 1,the `mobile-html` endpoint) as Android & iOS apps do to avoid creating a pageview data loss once the updated/fixed app is released to the users. 2
LIMIT 100
```
| endpoint | http_status | request_count |
|---|---|---|
| mobile-sections | 403 | 3579 |See {T257860} for additional context.