Suppress sports-widget error UI during one-week-to-kickoff phase when a cached schedule is available
Categories
(Firefox for Android :: Homepage, task)
Tracking
()
People
(Reporter: skhan, Assigned: skhan)
References
Details
(Whiteboard: [fxdroid][group3][world-cup-phase2])
Attachments
(3 external files)
Description:
During the one-week-to-kickoff phase (SportsWidgetState.isOneWeekToWorldCup), the widget currently collapses the entire pager to a single SportsWidgetErrorCard whenever a fetch fails — whether the user is offline(ConnectionInterrupted) or the server returns an error (LoadFailed). This is correct behavior once the tournament has started and live scores might be stale, but during the pre-tournament week it's too aggressive: the user has already seen the schedule, the schedule is in cache (SportsWidgetState.matchCardStates), and there are no live scores that could be wrong. Replacing the cached schedule with an error banner removes useful content the user can still consult.
** Expected behavior:**
- Phase 2 (isOneWeekToWorldCup) + error + cache has matches → keep showing the promo + cached schedule, suppress the error UI entirely.
- Phase 2 + error + cache empty → show the error card (user has nothing to fall back on; same as today).
- hasWorldCupStarted → unchanged. Errors must surface during the tournament — either inline-swapped on the live match or as a collapsed error card if no live match is in progress.
** Steps to reproduce:**
- Get the widget into phase 2 (debug drawer toggle: "One week to World Cup").
- Let the schedule fetch succeed once so matchCardStates is populated.
- Toggle airplane mode (or point the debug drawer at the mock server with a failing session).
- Resume Home.
Expected: still see the "Follow your team" promo card and the schedule pages.
Actual (today): pager collapses to a single error card.
During the one-week-to-kickoff phase (isOneWeekToWorldCup), there are no
live scores that could be wrong — just a schedule the user has already
seen. Collapsing the whole pager to a single SportsWidgetErrorCard on
every fetch failure removes useful cached content. Suppress the error UI
in this phase when matchCardStates is non-empty; only fall back to the
error card when the cache is empty and the user truly has nothing else
to look at. hasWorldCupStarted behavior is unchanged — errors there must
still surface, either inline-swapped on the live match or as a collapsed
error card if no live match is in progress.
Also promotes sportsCardPages and SportsCardPagesResult from private to
internal so the new behavior can be exercised by a unit-test suite that
doesn't require a Compose harness.
Updated•5 months ago
|
During the one-week-to-kickoff phase (isOneWeekToWorldCup), there are no
live scores that could be wrong — just a schedule the user has already
seen. Collapsing the whole pager to a single SportsWidgetErrorCard on
every fetch failure removes useful cached content. Suppress the error UI
in this phase when matchCardStates is non-empty; only fall back to the
error card when the cache is empty and the user truly has nothing else
to look at. hasWorldCupStarted behavior is unchanged — errors there must
still surface, either inline-swapped on the live match or as a collapsed
error card if no live match is in progress.
Also promotes sportsCardPages and SportsCardPagesResult from private to
internal so the new behavior can be exercised by a unit-test suite that
doesn't require a Compose harness.
Original Revision: https://phabricator.services.mozilla.com/D303086
Updated•5 months ago
|
Comment 5•5 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Low impact. But users will face errors even when we have cache data available only in case of user being offline or server error which is fine but if we have cache available we should show that instead which is what the patch is doing
- Code covered by automated testing?: yes
- Fix verified in Nightly?: no
- Needs manual QE testing?: yes
- Steps to reproduce for manual QE testing: 1. Debug drawer → toggle “One week to World Cup” ON, “World cup started” OFF.
2. Enable mock server, enter a known-good session ID, tap Apply. Wait for schedule to appear.
3. Go back to Home, confirm you see the “Follow your team” promo + schedule pages.
4. Background the app, enable airplane mode (or disable wifi/data).
5. Reopen Home (foregrounding triggers onResume → offline path → FetchFailed(ConnectionInterrupted)).
6. Expected (new behavior): promo + schedule still visible. No error card.
7. Before this fix: pager would collapse to a single error card
Same works for server errors
- Risk associated with taking this patch: low
- Explanation of risk level: Firstly guarded by nimbus.
Secondly this is just an improvement to show cached data when user is offline or server error. But it's not a big deal if we didn't show cache and surfaced the error cards in those scenarios - String changes made/needed?: no
- Is Android affected?: yes
Updated•5 months ago
|
Updated•5 months ago
|
During the one-week-to-kickoff phase (isOneWeekToWorldCup), there are no
live scores that could be wrong — just a schedule the user has already
seen. Collapsing the whole pager to a single SportsWidgetErrorCard on
every fetch failure removes useful cached content. Suppress the error UI
in this phase when matchCardStates is non-empty; only fall back to the
error card when the cache is empty and the user truly has nothing else
to look at. hasWorldCupStarted behavior is unchanged — errors there must
still surface, either inline-swapped on the live match or as a collapsed
error card if no live match is in progress.
Also promotes sportsCardPages and SportsCardPagesResult from private to
internal so the new behavior can be exercised by a unit-test suite that
doesn't require a Compose harness.
Original Revision: https://phabricator.services.mozilla.com/D303086
3m
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Comment 9•5 months ago
|
||
Verified as fixed on the latest Firefox for Android Nightly 153.0a1 from 6/1, Beta 152.0b6, and 151.0.3 build 1, using a Pixel tablet (Android 16).
However, if the app is killed (closed even from recent apps), then re-opened, the "Looks like you're offline." error card is displayed.
If the app is only sent in the background and reopened, the "Follow your team" promo card and the schedule pages are still displayed.
Sarah, let us know if this is not the expected behavior.
Description
•