Closed Bug 2043299 Opened 5 months ago Closed 5 months ago

Suppress sports-widget error UI during one-week-to-kickoff phase when a cached schedule is available

Categories

(Firefox for Android :: Homepage, task)

All
Android
task

Tracking

()

VERIFIED FIXED
153 Branch
Tracking Status
firefox151 --- verified
firefox152 --- verified
firefox153 --- verified

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:**

  1. Get the widget into phase 2 (debug drawer toggle: "One week to World Cup").
  2. Let the schedule fetch succeed once so matchCardStates is populated.
  3. Toggle airplane mode (or point the debug drawer at the mock server with a failing session).
  4. 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.

Assignee: nobody → skhan
Status: NEW → ASSIGNED
Pushed by skhan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9832791536e2 https://hg.mozilla.org/integration/autoland/rev/e4dde462f52d Suppress sports-widget error UI during one-week-to-kickoff phase when a cached schedule is available r=android-reviewers,moyin
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch

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

Attachment #9591482 - Flags: approval-mozilla-beta?

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
Flags: qe-verify+
Attachment #9591482 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

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

Attachment #9591775 - Attachment description: WIP: Bug 2043299 - Suppress sports-widget error UI during one-week-to-kickoff phase when a cached schedule is available → Bug 2043299 - Suppress sports-widget error UI during one-week-to-kickoff phase when a cached schedule is available
Attachment #9591775 - Flags: approval-mozilla-release+
Whiteboard: [fxdroid][group3][world-cup-phase2]
QA Whiteboard: [qa-triage-done-c153/b152]

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.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triage-done-c153/b152]
Flags: qe-verify+ → needinfo?(skhan)

That is the expected behavior!

Flags: needinfo?(skhan)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: