mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-08 09:57:21 -05:00
[PR #1440] [MERGED] fix(staffml): re-nest worker response — practice page white-screen #7309
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1440
Author: @profvjreddi
Created: 4/22/2026
Status: ✅ Merged
Merged: 4/22/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/hydration-shape-mismatch📝 Commits (1)
2cf5444fix(staffml): re-nest worker response in getQuestionFullDetail📊 Changes
1 file changed (+21 additions, -4 deletions)
View changed files
📝
interviews/staffml/src/lib/corpus.ts(+21 -4)📄 Description
Bug
Loading any hydrated question on /practice white-screens the page. Reported on https://mlsysbook.ai/staffml/practice?q=tinyml-exp2-reca-0117.
Root cause
Worker response and site Question type have different shapes:
Worker returns (D1 rows are flat):
Site expects:
getQuestionFullDetailmerged them naively, settingdetails: undefined. First render after hydration →current.details.napkin_math→ TypeError.Fix
Re-nest the flat worker fields into a
detailsobject insidegetQuestionFullDetail. Preserves MCQ options/correct_index from the summary. Forward-compatible if the worker later emits a nesteddetailsobject.Test
npx next buildsucceeds🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.