Skip to content

feat(rewards): add Ondo campaign participant outcome support#29267

Merged
VGR-GIT merged 13 commits into
mainfrom
rwds-ondo-gm-campaign-participant-outcome-2
Apr 23, 2026
Merged

feat(rewards): add Ondo campaign participant outcome support#29267
VGR-GIT merged 13 commits into
mainfrom
rwds-ondo-gm-campaign-participant-outcome-2

Conversation

@VGR-GIT

@VGR-GIT VGR-GIT commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Description

Implement mechanics around Ondo GM participant outcome

Changelog

CHANGELOG entry: null

Screenshots/Recordings

  • On details/stats page, showing that we're still working on it. Only if you opted in and status is pending and no winner code from api response
image image

Note that we're no longer showing the banners that were shown in this section when the competition was active. (i.e. qualified, not eligible, ...)

  • On details/stats page, showing that a user didn't win. Only if you opted in and status is finalized and no winner code from api response
image image
  • Winning view that we auto show when a user visits the ondo gm details page, the campaign is completed and the outcome status is pending & we have a verification code
image

The bannner on the details page/stats page for these kind of users:

image image
  • On details/stats page, showing that a user won & they'll receive their reward shortly. Only if you opted in and status is finalized and winner code from api response
image image

Note

Medium Risk
Introduces a new authenticated/cached API flow (getOndoCampaignParticipantOutcome) and rewires winner navigation/banners across multiple Ondo screens, which could impact post-campaign UX and routing. Data contract changes (new DTO/status) and removed retry/error UI increase the chance of edge-case regressions if the endpoint returns unexpected/null values.

Overview
Adds end-of-campaign participant outcome support for Ondo GM, replacing the old “winner code”/leaderboard-based winner detection.

The UI now fetches useOndoCampaignParticipantOutcome when a campaign is complete and the user is opted in, shows new outcome banners (pending/finalized, winner vs non-winner), and auto-navigates to the winning screen only when the outcome is pending and a winnerVerificationCode exists. The winning screen now derives the code from the outcome, disables copy when absent, and redirects back to details if the user has no winner code.

On the backend, replaces getOndoCampaignWinnerCode with getOndoCampaignParticipantOutcome end-to-end (controller action + data service endpoint /ondo-gm/:id/outcome/me), adds a new outcome DTO/status type, and caches non-null outcomes with a TTL.

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

Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@VGR-GIT VGR-GIT requested a review from a team as a code owner April 23, 2026 14:07
@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 team-rewards Rewards team INVALID-PR-TEMPLATE PR's body doesn't match template labels Apr 23, 2026
@github-actions github-actions Bot added size-XL risk:high AI analysis: high risk labels Apr 23, 2026
Comment thread app/components/UI/Rewards/Views/OndoCampaignDetailsView.tsx Outdated
Comment thread app/components/UI/Rewards/Views/OndoCampaignDetailsView.test.tsx Outdated
Comment thread app/components/UI/Rewards/Views/OndoCampaignDetailsView.tsx

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6c8bc6a. Configure here.

Comment thread app/components/UI/Rewards/hooks/useOndoCampaignEndedOutcomeToast.ts Outdated
VGR-GIT and others added 6 commits April 23, 2026 17:16
- Add useOndoCampaignParticipantOutcome.test.ts (new file, 100% coverage)
- Remove stale getOndoCampaignWinnerCode test blocks from RewardsController.test.ts and rewards-data-service.test.ts (method no longer exists)
- Add branch-coverage tests to OndoCampaignStatsView and OndoCampaignWinningView (routeCampaignName fallback, null winningCode paths)
- New code coverage: 100% (64/64 changed lines)

Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@VGR-GIT VGR-GIT enabled auto-merge April 23, 2026 15:32
@MetaMask MetaMask deleted a comment from github-actions Bot Apr 23, 2026
jbblanc
jbblanc previously approved these changes Apr 23, 2026
jonson
jonson previously approved these changes Apr 23, 2026
@VGR-GIT VGR-GIT dismissed stale reviews from jonson and jbblanc via 7e0f1bd April 23, 2026 16:15
@github-actions

Copy link
Copy Markdown
Contributor

AI PR Analysis

🚫 Merge safe: false | 🟠 Risk: high

Merge decision: AI analysis did not complete — manual review required before merging.

AI analysis did not complete. Manual review recommended.

View run

Comment thread locales/languages/en.json
"a11y": "Open winner details"
},
"participant_pending": {
"title": "Contest has ended.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Campaign has ended"

Comment thread locales/languages/en.json
},
"participant_pending": {
"title": "Contest has ended.",
"description": "We're determining the contest winners. Check back soon."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"We're determining the results. Check back soon."

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR makes targeted changes entirely within the Rewards/Ondo campaign feature:

  1. RewardsController: Renames getOndoCampaignWinnerCodegetOndoCampaignParticipantOutcome, changes the API endpoint from /winner-code/me to /outcome/me, updates the return type from string to OndoGmCampaignParticipantOutcomeDto, and adds in-memory caching with error handling.

  2. RewardsDataService & Messenger: Corresponding type/action renames to match the new method name.

  3. UI Components: Replaces OndoWinnerBanner with OndoCampaignOutcomeBanners (multiple variants), replaces useOndoCampaignWinnerCode hook with useOndoCampaignParticipantOutcome, and updates views (OndoCampaignDetailsView, OndoCampaignStatsView, OndoCampaignWinningView, CampaignStatsSummary) to use the new outcome-based logic.

  4. Locales: Updated string keys for outcome banners.

Why no E2E tags are needed:

  • No existing E2E tests cover Rewards/Ondo campaign functionality (confirmed by searching tests/smoke/ directory)
  • Changes are isolated to the Rewards feature - no shared components (TabBar, Browser, Confirmations, Navigation) are affected
  • The RewardsController changes don't affect Engine initialization, other controllers, or the controller messenger for non-rewards features
  • The selector change (selectCampaignParticipantStatus accepting null) is a minor type widening with no behavioral change
  • No tags like SmokePerps, SmokeWalletPlatform, or SmokePredictions have tests that exercise Ondo campaign winner/outcome flows

The changes are well-contained within the rewards feature domain and are covered by unit tests (RewardsController.test.ts, rewards-data-service.test.ts, and component tests). Running E2E tests would not provide additional validation for these specific changes.

Performance Test Selection:
No performance-sensitive code paths are affected. The changes are within the Rewards/Ondo campaign feature which is a specialized feature not related to app startup, account/network list rendering, login flows, or other performance-critical paths. The caching added to RewardsController is a minor optimization that would not negatively impact performance.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@VGR-GIT VGR-GIT added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit d5fcd00 Apr 23, 2026
61 of 64 checks passed
@VGR-GIT VGR-GIT deleted the rwds-ondo-gm-campaign-participant-outcome-2 branch April 23, 2026 18:40
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.75.0 Issue or pull request that will be included in release 7.75.0 label Apr 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-7.75.0 Issue or pull request that will be included in release 7.75.0 risk:high AI analysis: high risk size-XL team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants