feat(rewards): add deeplinks for campaigns & musd pages#28802
Conversation
|
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. |
ac0fcd5 to
d343624
Compare
|
Beep boop, claude here for Rik Van Gulck; @sophieqgu heads up — there is a known limitation with the current deeplink routing implementation: Known limitation: If a user opens a deeplink targeting a Rewards sub-view (e.g., Why it happens: The plain This is a future follow-up; the current implementation already covers the primary use case (user is on a different tab when the deeplink is opened). |
bad839d to
515f8c2
Compare
The 481803c commit re-introduced `pendingSheetPosition={leaderboardPendingSheetPosition}` to OndoLeaderboard's JSX, but `leaderboardPendingSheetPosition` was removed by the prior "remove pending sheet" commit and OndoLeaderboard no longer accepts this prop. This caused a ReferenceError in every test that rendered the leaderboard section. Component fix: - Remove the stale `pendingSheetPosition` prop from OndoLeaderboard Test fixes: - Mock useOndoAccountPicker (breaks @tanstack/react-query import chain) with a stateful implementation so the account-picker sheet tests work - Mock useAnalytics and core/Analytics (break store/DeeplinkManager import chain triggered by OndoCampaignCTA) - Fix useTailwind mock to return a callable function (Box uses tagged template literals tw`...`) - Stub Skeleton which is absent from the installed design-system version Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 2289729. Configure here.
|
|
||
| // Pending deeplink navigation intent, stored in Redux so it survives the | ||
| // UnmountOnBlur remount of RewardsHome when navigating from outside the tab. | ||
| pendingDeeplink: PendingDeeplink | null; |
There was a problem hiding this comment.
Stale persisted deeplink causes unexpected navigation on revisit
Medium Severity
The pendingDeeplink field is part of RewardsState which is persisted and rehydrated across app restarts. Once set, it's only cleared in two places: inside handleRewardsUrl (when no page/campaign param) and inside the RewardsNavigator useEffect (after successful consumption). If the deeplink is set but never consumed — e.g., a non-subscribed user opens a deeplink, reaches onboarding, abandons it, then later returns to rewards via the tab bar (TabBar.tsx navigates directly to REWARDS_VIEW without calling handleRewardsUrl) — the stale pendingDeeplink persists in Redux and triggers unexpected navigation to the old deeplink target. This stale state also survives app restarts via rehydration.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 2289729. Configure here.
Co-authored-by: VGR-GIT <vangulckrik@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace direct useState import reference in mock factory with
jest.requireActual('react').useState to comply with Jest's hoisting
restrictions on out-of-scope variables in mock factories.
Co-authored-by: VGR-GIT <vangulckrik@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: No dedicated Rewards E2E test tag exists. The closest coverage is SmokeWalletPlatform, which includes the musd-conversion-happy-path.spec.ts test that exercises the mUSD/Rewards flow. This test uses the SmokeWalletPlatform tag and validates the Rewards ecosystem. The changes do NOT affect:
Risk is medium because:
Confidence is 72 because there are no dedicated Rewards E2E tests, so coverage is indirect through SmokeWalletPlatform's mUSD tests. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|





Description
Extends the
/rewardsdeeplink handler to support?page=and?campaign=query params, enabling deep navigation to specific pages within the Rewards flow.Jira: https://consensyssoftware.atlassian.net/browse/RWDS-1152
New deeplinks
/rewards?page=campaigns/rewards?campaign=ondo/rewards?campaign=season1/rewards?page=musdBehaviour
Changelog
CHANGELOG entry: new reward campaign deeplinks + musd
Checklist
🤖 Generated with Claude Code
Note
Medium Risk
Changes core navigation behavior for subscribed Rewards users and introduces new persisted state, so regressions could misroute users or loop navigations despite added tests and guards.
Overview
Adds support for
/rewardsdeeplinks with?page=and?campaign=query params by persisting apendingDeeplinkintent in the rewards Redux slice, so navigation survivesUnmountOnBlurremounts.Updates
RewardsNavigatorto consumependingDeeplinkfor subscribed users (routing to campaigns, Ondo/Season 1 details, mUSD calculator, or benefits) and then clear the intent with a one-shotuseRefguard to prevent a follow-up effect from overriding the deeplink with a dashboard navigation.Adjusts campaign detail screens to tolerate missing
campaignIdroute params (deeplink entry) by resolving the campaign byCampaignType, and updatesuseOndoAccountPickerto accept an optional campaign id. Test coverage is expanded across the deeplink handler, navigator routing/clearing behavior, and some view test stubbing to avoid deep import dependencies.Reviewed by Cursor Bugbot for commit 748afe7. Bugbot is set up for automated code reviews on this repo. Configure here.