Skip to content

fix(predict): preserve game market outcomes in staleness filtering cp-7.79.0#30699

Merged
caieu merged 1 commit into
mainfrom
predict/PRED-934-fix-incomplete-outcome-display-on-world-cup-game-cards
May 27, 2026
Merged

fix(predict): preserve game market outcomes in staleness filtering cp-7.79.0#30699
caieu merged 1 commit into
mainfrom
predict/PRED-934-fix-incomplete-outcome-display-on-world-cup-game-cards

Conversation

@caieu

@caieu caieu commented May 27, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes World Cup/sports game cards that could show only two outcomes for draw-capable moneyline games when one outcome had very low odds.

The shared market staleness filter removes outcomes priced at or below 5% or at or above 95%. That behavior is useful for multi-outcome non-game cards, but it breaks game cards that need the complete moneyline set. For example, Germany vs. Curacao has Germany, Draw, and Curacao outcomes, but Curacao can be priced below 5%. Once that outcome is filtered out, the card falls back to a binary path and the away-team button can open the No token for the favorite instead of the underdog moneyline.

This change skips stale-price outcome filtering and stale-price ranking penalties for game markets. Closed markets and ended games are still filtered out as before.

Changelog

CHANGELOG entry: Fixed a bug where sports game cards could hide low-probability outcomes and open the wrong prediction.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/PRED-934?atlOrigin=eyJpIjoiZjVmNDJkY2I3NzBjNGQ4MjgwZWY5MjQ5ZjcyOTlkYWMiLCJwIjoiaiJ9

Manual testing steps

Feature: World Cup game card outcomes

  Scenario: user opens a draw-capable World Cup game card with a low-probability away team
    Given the World Cup feed includes a game with home, draw, and away moneyline outcomes
    And one of the moneyline outcomes is priced at or below 5%

    When user views the game card
    Then the card shows all available moneyline outcomes

    When user taps the away-team prediction button
    Then the buy sheet opens for the away-team outcome, not the favorite team's No token

Screenshots/Recordings

Before

Screenshot 2026-05-27 at 14 27 35

After

Screenshot 2026-05-27 at 14 27 49

Testing

  • node .yarn/releases/yarn-4.14.1.cjs jest app/components/UI/Predict/utils/marketStaleness.test.ts

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Scoped to Predict visibility/ranking utilities; closed and ended games remain hidden; non-game staleness behavior unchanged.

Overview
Game markets with a game attachment are now exempt from Predict’s stale-price outcome filtering (≤5% / ≥95%) and from staleness-based feed ranking penalties, matching the existing highlighted market behavior.

getVisiblePredictMarket returns the full market for open game markets after the usual closed/expired checks, so moneyline sets (e.g. home / draw / away) stay intact when an underdog is priced very low. Non-game cards still drop “dead” outcomes and can be deprioritized in the list.

Tests cover full outcome preservation on game cards and unchanged ordering when a game market would otherwise be penalized.

Reviewed by Cursor Bugbot for commit 2ead89a. Bugbot is set up for automated code reviews on this repo. Configure here.

Skip stale-price outcome filtering and ranking penalties for game markets so
draw-capable sports cards keep all moneyline outcomes visible in feeds.
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbotv2 metamaskbotv2 Bot added the team-predict Predict team label May 27, 2026
@caieu caieu marked this pull request as ready for review May 27, 2026 17:29
@caieu caieu requested a review from a team as a code owner May 27, 2026 17:29
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are isolated to app/components/UI/Predict/utils/marketStaleness.ts and its test file. Two small logic changes: (1) game markets now receive a staleness penalty of 1 (no penalty) instead of being evaluated for stale prices, and (2) game markets are returned as-is in getVisiblePredictMarket without filtering stale-priced outcomes. This affects how sports/game markets are ranked and displayed in the Predictions UI. The utility is consumed by Predict hooks (usePredictMarketData, usePredictSearchMarketData, usePredictWorldCup, useFeaturedCarouselData). SmokePredictions is selected as the primary tag for Predictions feature validation. SmokeWalletPlatform is selected because Predictions is a section inside the Trending tab, and changes to Predictions views affect Trending per the tag description. No confirmations, navigation, or shared components are affected, so no other tags are needed.

Performance Test Selection:
The changes are pure utility/logic changes to market staleness calculation and filtering. No UI rendering, data loading, state management, or performance-sensitive code paths are modified. No performance tests are warranted.

View GitHub Actions results

@caieu caieu changed the title fix(predict): preserve game market outcomes in staleness filtering fix(predict): preserve game market outcomes in staleness filtering cp-7.79.0 May 27, 2026
@caieu caieu enabled auto-merge May 27, 2026 17:42
@sonarqubecloud

Copy link
Copy Markdown

@caieu caieu added this pull request to the merge queue May 27, 2026
Merged via the queue into main with commit 1de71fb May 27, 2026
225 of 249 checks passed
@caieu caieu deleted the predict/PRED-934-fix-incomplete-outcome-display-on-world-cup-game-cards branch May 27, 2026 18:44
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.80.0 Issue or pull request that will be included in release 7.80.0 label May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.80.0 Issue or pull request that will be included in release 7.80.0 size-S team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants