[Homepage Sports Widget] - Enable pre-tournament sports widget pager with cached schedule fetch and Nimbus rollout
Categories
(Firefox for Android :: Homepage, task)
Tracking
()
People
(Reporter: skhan, Assigned: skhan)
References
Details
(Whiteboard: [fxdroid][group3][world-cup-phase2])
Attachments
(8 external files)
When the user opens the homepage before World Cup kickoff (2026-06-11) and the
sports widget is showing the pre-tournament pager, we want to render a
"Follow your team" countdown card alongside a "view schedule" card backed by
real fixtures from the Merino WCS endpoint. The existing data flow had three
shortcomings:
- The repository fetched + shaped MatchCards per team selection, so toggling
the followed team always triggered another network round-trip — including
when the user just deselected a team or switched between two teams. - The WCS endpoint only returns matches within +/-10 days of the requested
date. Withdatedefaulting to today and kickoff still ~30 days away,
pre-tournament fetches returned no fixtures and the pager stayed empty. - There was no way to enable the pre-tournament UI for a Nimbus experiment
cohort independent of the device's calendar date, so QA and staggered
rollouts had to wait until June 4, 2026 (one week to kickoff).
Updated•6 months ago
|
SportsRepository.fetchMatches no longer takes a countryCodes parameter or
shapes MatchCards; it now returns the bucketed TeamMatchesResult straight
from the mapper. SportsWidgetMiddleware caches the result in memory and
filters by team locally so toggling the followed team rebuilds the pager
without another network round-trip (with a fetch fallback on cold cache).
The middleware also reacts to the two debug-tool override actions so
flipping a switch in the SportsWidgetDebugTool triggers a fresh fetch
without requiring a HomeFragment.onResume.
Adds a force-one-week-to-world-cup Boolean to the homepage-sports-widget
Nimbus feature so the pre-tournament pager flow can be enabled for an
experiment cohort regardless of the device date. The flag is plumbed
through Settings into SportsWidgetState; the existing debug-tool override
still wins, and the natural date check still applies when neither is set.
Pins the WCS request date to the World Cup kickoff while the device date
is still before kickoff, since the endpoint only returns matches within
+/-10 days of the requested date. Otherwise sends today's date.
Extracts the kickoff date into shared constants in CountdownCalculator
(WORLD_CUP_KICKOFF: LocalDate for date math and the API request; and
WORLD_CUP_KICKOFF_UTC: String for the countdown widget's ISO instant)
so the kickoff is sourced from one place instead of being duplicated
inline across CountdownCalculator, SportsWidget, and the client.
Updated•6 months ago
|
https://hg.mozilla.org/mozilla-central/rev/8746be6f2f6e
https://hg.mozilla.org/mozilla-central/rev/4726e75a8e25
SportsRepository.fetchMatches no longer takes a countryCodes parameter or
shapes MatchCards; it now returns the bucketed TeamMatchesResult straight
from the mapper. SportsWidgetMiddleware caches the result in memory and
filters by team locally so toggling the followed team rebuilds the pager
without another network round-trip (with a fetch fallback on cold cache).
The middleware also reacts to the two debug-tool override actions so
flipping a switch in the SportsWidgetDebugTool triggers a fresh fetch
without requiring a HomeFragment.onResume.
Original Revision: https://phabricator.services.mozilla.com/D300687
Adds a force-one-week-to-world-cup Boolean to the homepage-sports-widget
Nimbus feature so the pre-tournament pager flow can be enabled for an
experiment cohort regardless of the device date. The flag is plumbed
through Settings into SportsWidgetState; the existing debug-tool override
still wins, and the natural date check still applies when neither is set.
Pins the WCS request date to the World Cup kickoff while the device date
is still before kickoff, since the endpoint only returns matches within
+/-10 days of the requested date. Otherwise sends today's date.
Extracts the kickoff date into shared constants in CountdownCalculator
(WORLD_CUP_KICKOFF: LocalDate for date math and the API request; and
WORLD_CUP_KICKOFF_UTC: String for the countdown widget's ISO instant)
so the kickoff is sourced from one place instead of being duplicated
inline across CountdownCalculator, SportsWidget, and the client.
Original Revision: https://phabricator.services.mozilla.com/D300688
SportsRepository.fetchMatches no longer takes a countryCodes parameter or
shapes MatchCards; it now returns the bucketed TeamMatchesResult straight
from the mapper. SportsWidgetMiddleware caches the result in memory and
filters by team locally so toggling the followed team rebuilds the pager
without another network round-trip (with a fetch fallback on cold cache).
The middleware also reacts to the two debug-tool override actions so
flipping a switch in the SportsWidgetDebugTool triggers a fresh fetch
without requiring a HomeFragment.onResume.
Original Revision: https://phabricator.services.mozilla.com/D300687
Adds a force-one-week-to-world-cup Boolean to the homepage-sports-widget
Nimbus feature so the pre-tournament pager flow can be enabled for an
experiment cohort regardless of the device date. The flag is plumbed
through Settings into SportsWidgetState; the existing debug-tool override
still wins, and the natural date check still applies when neither is set.
Pins the WCS request date to the World Cup kickoff while the device date
is still before kickoff, since the endpoint only returns matches within
+/-10 days of the requested date. Otherwise sends today's date.
Extracts the kickoff date into shared constants in CountdownCalculator
(WORLD_CUP_KICKOFF: LocalDate for date math and the API request; and
WORLD_CUP_KICKOFF_UTC: String for the countdown widget's ISO instant)
so the kickoff is sourced from one place instead of being duplicated
inline across CountdownCalculator, SportsWidget, and the client.
Original Revision: https://phabricator.services.mozilla.com/D300688
SportsRepository.fetchMatches no longer takes a countryCodes parameter or
shapes MatchCards; it now returns the bucketed TeamMatchesResult straight
from the mapper. SportsWidgetMiddleware caches the result in memory and
filters by team locally so toggling the followed team rebuilds the pager
without another network round-trip (with a fetch fallback on cold cache).
The middleware also reacts to the two debug-tool override actions so
flipping a switch in the SportsWidgetDebugTool triggers a fresh fetch
without requiring a HomeFragment.onResume.
Original Revision: https://phabricator.services.mozilla.com/D300687
| Assignee | ||
Comment 10•5 months ago
|
||
Adds a force-one-week-to-world-cup Boolean to the homepage-sports-widget
Nimbus feature so the pre-tournament pager flow can be enabled for an
experiment cohort regardless of the device date. The flag is plumbed
through Settings into SportsWidgetState; the existing debug-tool override
still wins, and the natural date check still applies when neither is set.
Pins the WCS request date to the World Cup kickoff while the device date
is still before kickoff, since the endpoint only returns matches within
+/-10 days of the requested date. Otherwise sends today's date.
Extracts the kickoff date into shared constants in CountdownCalculator
(WORLD_CUP_KICKOFF: LocalDate for date math and the API request; and
WORLD_CUP_KICKOFF_UTC: String for the countdown widget's ISO instant)
so the kickoff is sourced from one place instead of being duplicated
inline across CountdownCalculator, SportsWidget, and the client.
Original Revision: https://phabricator.services.mozilla.com/D300688
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Comment 11•5 months ago
|
||
| uplift | ||
Comment 12•5 months ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
Updated•5 months ago
|
Description
•