Page MenuHomePhabricator

iOS widgets fail together when one field is missing from the feed
Closed, ResolvedPublic0 Estimated Story PointsBUG REPORT

Description

Background

On 2026-09-17 every iOS widget (Top Read, Featured Article, Picture of the Day) broke at the same time. Picture of the Day showed the sample image (Picture of the Year 2019, "the bulls") and the other widgets showed placeholders.

The cause was a single field: the image object in en.wikipedia.org/api/rest_v1/feed/featured/2026/09/17 came without description. The widget models decode the whole WidgetFeaturedContent at once with non-optional fields, so one missing key fails the decode of the entire payload and every widget falls back to sample content. The card in the Explore feed was not affected because the main app uses its own Objective-C models with a fallback to the file name.

Steps to reproduce

  • Install the app on a device with the Picture of the Day, Top Read and Featured Article widgets on the home screen.
  • Set the app language to a wiki whose feed of the day omits a field the widget models require (on 2026-09-17, English).
  • Wait for the widgets to refresh.

Expected

Each widget shows the content of the sections that did decode. A missing caption shows the image without a caption.

Actual

All widgets show sample or placeholder content, and nothing records why.

Proposed solution

  • Decode each feed section (tfa, mostread, onthisday, image) independently, so a broken section becomes nil and the others survive.
  • Decode arrays element by element, dropping only the article or event that fails.
  • Make optional every field the widgets do not render, including description and license of the picture of the day, and fall back to the Commons structured caption when the feed has no description.
  • When a section is missing, carry the previous cached section over, flagged as stale, instead of showing sample content. When the whole fetch fails, serve the previous cache as is and retry in one hour.
  • Record the result of the last fetch (date, language, HTTP status, decoding error per section) in the shared widget cache and show it in Developer Settings, with a button to clear the cache and reload the widgets.
  • Add a daily GitHub Actions job that decodes the live feed for en, de, ja, ar and zh with the widget models, so a feed change is visible before it reaches home screens.

QA steps

  • With the 2026-09-17 payload (added as a unit test fixture), all three widgets show content; Picture of the Day shows the image with the structured caption.
  • Developer Settings > Widgets lists the cached sections and the last fetch result, including the section that failed and the JSON path.
  • "Clear cache and reload widgets" empties the cache and the widgets refresh from the network.
  • Switching the app language refreshes the widgets in the new language.

Event Timeline

Restricted Application added subscribers: hubaishan, Aklapper. · View Herald Transcript

I added a new menu on developer settings to help with widget testing:

  1. Add the Featured Article, Top Read and Picture of the Day widgets to the home screen. All three show content for today, and Picture of the Day shows a caption even when the feed has no description (English on 2026-09-17).
  2. O pen Profile > Settings > Developer Settings. The "Widgets" section lists the cached sections and "Last widget fetch" lists the last result. Tap "Clear cache and reload widgets": the widgets refresh from the network.
  3. Turn on Airplane Mode and force a widget refresh (change the app language and back, or wait for the next timeline). The widgets keep showing the previous content instead of sample content.

654170178-57d90419-5311-4a03-a989-c2e72cf9731f.png (1,179×2,556 px, 459 KB)

2026.09.19 onwards will have this change and is ready for QA. This is a visible change and worth prioritising earlier QA

Seddon set the point value for this task to 0.
ABorbaWMF subscribed.

Build: 6180-beta-2026-09-22
Tested on:
iPhone 16, iOS 26.6
iPad Air, iPadOS 26.6
iPhone SE, iOS 26.5.2

This is mostly working for me. The only exception is in this test when choosing French or Portuguese (so far) as the primary language:
Turn on Airplane Mode and force a widget refresh (change the app language and back, or wait for the next timeline). The widgets keep showing the previous content instead of sample content.