Repository navigation
Fix report_group list bloat and PDF report timeouts - #125
Merged
Merged
Conversation
signatureData stores a base64 image and was being pulled on every list/getOne request even though the datagrid never renders it, bloating list responses. Excluding it from the CRUD select doesn't affect writes (create/update, bulk updateSignatureData) or the lessonSignaturePdf report, which fetch it via direct repository queries outside the CRUD builder.
reportGroupSessionsSummary, studentReportCardReact and lessonSignaturePdfReport all pulled a fonts.googleapis.com <link> into their PDF markup, waited networkidle0 on it in Puppeteer, and hung for the full 30s navigation timeout when that host wasn't reachable - confirmed as the cause of the sessionsSummary report failures. Points at nra-server's new self-hosted @font-face bundle (useFontFaceCss) instead of the old useFontLinks, so PDF generation no longer depends on live network access at all. Bumps server/shared to buzz-code/nra-server@a4f252b.
Holding off on self-hosted fonts. Reports go back to useFontLinks against fonts.googleapis.com. The fix that actually matters for the timeout bug stays in nra-server's markup-to-pdf.generator.ts: 10s timeout instead of 30s, with a no-network-wait fallback render. Bumps server/shared to buzz-code/nra-server@0f837a2.
Points at buzz-code/nra-server@8eb4b42, the merge of the timeout+fallback fix for PDF report generation (page.setContent now times out at 10s instead of 30s, falls back to a network-free render).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
report_grouplist/filter requests were pullingsignatureData(base64 signature image) on every row even though the list view never renders it - excluded it from the CRUD select (server/src/entity-modules/report-group.config.ts), reads only, writes/replace flow unaffected.sessionsSummaryPDF report generation was timing out and failing with 500s in prod - reproduced live and confirmed root cause: report markup pulls a font stylesheet fromfonts.googleapis.comat render time, and Puppeteer'spage.setContentwaitsnetworkidle0with the default 30s timeout, so an unreachable/slow font fetch hangs the whole request.nra-server, bumped via submodule):page.setContentnow times out at 10s instead of 30s, falling back to a render that doesn't wait on network at all. Reports keep fetching fonts from Google as before - not moving to self-hosted fonts for now.Test plan
yarn test- 912/912 passing in both reposTimeoutError: Navigation timeout of 30000 ms exceededfailure with a blackholed font fetch, confirmed the 10s+fallback change resolves it without a 500updateSignatureDataandlessonSignaturePdfreport use direct repository queries, bypassing the CRUD builder'sexclude)Generated by Claude Code