Skip to content

fix(react): resolve flight chunk references in snapshotQuestList - #626

Open
phanex wants to merge 1 commit into
TheNetsky:v4from
phanex:fix/quest-flight-chunks
Open

phanex wants to merge 1 commit into
TheNetsky:v4from
phanex:fix/quest-flight-chunks

Conversation

@phanex

@phanex phanex commented Oct 16, 2026

Copy link
Copy Markdown

Title:

fix(react): resolve React Flight stream chunk references in snapshotQuestList

Description:

Summary

In the Next.js App Router (React Server Components), Microsoft Rewards frequently streams quest cards using deferred Flight stream chunk references (e.g. children: ["$L82", "$L83"]) instead of inlining the card component markup directly in the parent link block.

When this occurs, snapshotQuestList previously scanned only the immediate window (at + 4000) near the anchor link. Because the referenced chunks (containing the title, points badge ["+","50"], and progress 0 von 6) are streamed tens of thousands of characters down the stream, pointProgressMax defaulted to 0 and the title was missed or mismatched with subsequent sections. As a result, with skipNonPointTasks: true, actionable multi-step punchcards (such as the 50-point Halloween Quest or seasonal cards) were erroneously skipped.

Changes

  1. buildFlightChunkMap: Parses and maps Next.js RSC Flight stream chunk definitions (<id>:...) across the payload.
  2. Chunk Dereferencing: In snapshotQuestList, scans the card region for $L<id> references and dynamically appends the payload of referenced chunks.
  3. Points & Progress Matching:
    • Extended points badge regex to support both ["+","150"] and ["","150"] formats.
    • Extended progress regex to handle localized patterns (e.g., 0/6, 0 von 6, 0 of 6).
    • Ensures pointProgressMax correctly retains the maximum points detected across chunks.

Testing

  • Verified against live RSC Flight payloads where card contents were split across chunks $L82 and $L83.
  • TypeScript build (npm run build) and Prettier code style checks pass with 0 errors.

@MoonLGH

MoonLGH commented Oct 16, 2026

Copy link
Copy Markdown

lgtm

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.

2 participants