Skip to content

fix(rewards): add support for new /earn dashboard, Explore on Bing, and RewardsApp weekly punch cards (fixes #603) - #612

Open
phanex wants to merge 2 commits into
TheNetsky:v4from
phanex:fix/earn-tab-and-explore-on-bing
Open

phanex wants to merge 2 commits into
TheNetsky:v4from
phanex:fix/earn-tab-and-explore-on-bing

Conversation

@phanex

@phanex phanex commented Sep 17, 2026 •

Copy link
Copy Markdown

Summary of Changes

Microsoft Rewards has been transitioning cards and activities to the new /earn tab rendered via Next.js React Server Components (RSC), as well as converting app-exclusive activities into a new weekly punch card format. This PR introduces native support for these changes:

  1. Dynamic RSC Component Parsing (ReactFunc.ts):

    • Added findTextByClass() — a recursive tree-walker that extracts title, description, and points from RSC flight chunks using Fluent UI design tokens (text-globalBody2Strong, text-fgCtrlNeutralSecondaryRest, text-statusInformativeTintFg).
    • Works 100% dynamically across all locales/languages without any hardcoded activity IDs, queries, or localized words.
    • Cleans up invisible zero-width Unicode characters (\u200B-\u200D, \uFEFF) embedded by Microsoft's server-rendered text.
    • Preserves standard 10-point default for exploreonbing cards when shared badge elements are deduplicated into external flight chunk references ($Lxx).
  2. Universal Quest Completion Regex (ReactFunc.ts):

    • Simplified the task progress regex to (\d+)\s*\/\s*(\d+), relying solely on the universal fractional slash format (1/1, 1/5) present across all localized interfaces (instead of matching English "tasks").
    • Improved region boundary detection between parent quests.
  3. Centralized Promotion Adapter (offerAdapter.ts):

    • Extracted ParsedOffer to BasePromotion conversion into a single reusable adapter with safe defaults (exclusiveLockedFeatureStatus, priority, activityType) to maintain DRY and prevent downstream type issues.
  4. RSC Fallbacks in Activity Runners:

    • In DailySet.ts and MorePromotions.ts, added fallback to reactSnapshot.offers / reactSnapshot.reportable when the legacy dashboard API returns an empty list.
    • In PromotionActivityRunner.ts, check both name and offerId for exploreonbing.
  5. Aligned Server Action Context (UrlReward.ts):

    • Updated url, referer, and routerStateTree from legacy dashboard to earn to match the bootstrap context and default BrowserFunc behavior.
  6. RewardsApp Weekly Punch Card Support (PunchCards.ts):

    • Fixed isClaimChild() to avoid mistakenly matching reward within urlreward offer IDs (e.g. WW_pcchild{N}_urlreward_{Day}_RewardsApp_weekly_Exclusive_*).
    • Ensures unlocked daily children are routed and executed as standard UrlReward activities instead of falsely attempting to POST to the claim endpoint.

Testing

  • Tested against live accounts in multiple locales (including German de-DE).
  • Verified all active "Explore on Bing" cards are detected, searched on Bing, and credited successfully.
  • Verified unlocked daily RewardsApp punch card children are executed and credited properly.
  • Verified tomorrow/locked cards are properly skipped.
  • TypeScript build (npm run build) and ESLint (npm run lint) pass with 0 errors.

Fixes #603

… activities (fixes TheNetsky#603)

- Parse Explore on Bing activities dynamically from React Server Component (RSC) flight chunks via Fluent UI design tokens (findTextByClass), completely language-agnostic across all locales
- Strip zero-width Unicode characters (\u200B-\u200D, \uFEFF) from titles and descriptions
- Introduce offerAdapter to unify ParsedOffer to BasePromotion transformation with safe defaults
- Add fallback in DailySet and MorePromotions for RSC-only offers not returned by the legacy dashboard API
- Align UrlReward context with /earn (matching bootstrap and router state tree)
- Simplify quest completion regex to use universal slash-based task counts without language-specific keywords

@lasbt lasbt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Runned successfully on my machine

@phanex
phanex force-pushed the fix/earn-tab-and-explore-on-bing branch from c51bb01 to 28ebf5c Compare September 23, 2026 18:25
@phanex phanex changed the title fix(rewards): add support for new /earn dashboard and Explore on Bing activities (fixes #603) fix(rewards): add support for new /earn dashboard and Explore on Bing activities Sep 29, 2026
@phanex phanex changed the title fix(rewards): add support for new /earn dashboard and Explore on Bing activities fix(rewards): add support for new /earn dashboard, Explore on Bing, and RewardsApp weekly punch cards (fixes #603) Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App-only daily offers are missing from the parsed dashboard

2 participants