Skip to content

Fix report_group list bloat and PDF report timeouts - #125

Merged
buzz-code merged 4 commits into
mainfrom
claude/api-response-performance-1snxv1
Jul 19, 2026
Merged

buzz-code merged 4 commits into
mainfrom
claude/api-response-performance-1snxv1

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

  • report_group list/filter requests were pulling signatureData (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.
  • sessionsSummary PDF report generation was timing out and failing with 500s in prod - reproduced live and confirmed root cause: report markup pulls a font stylesheet from fonts.googleapis.com at render time, and Puppeteer's page.setContent waits networkidle0 with the default 30s timeout, so an unreachable/slow font fetch hangs the whole request.
  • Fix (in nra-server, bumped via submodule): page.setContent now 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 repos
  • Live repro: reproduced the exact prod TimeoutError: Navigation timeout of 30000 ms exceeded failure with a blackholed font fetch, confirmed the 10s+fallback change resolves it without a 500
  • Verified signature-exclude doesn't affect create/update/bulk-signature flows (updateSignatureData and lessonSignaturePdf report use direct repository queries, bypassing the CRUD builder's exclude)

Generated by Claude Code

claude added 4 commits July 19, 2026 19:22
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).
@buzz-code
buzz-code merged commit 9cd70be into main Jul 19, 2026
1 check passed
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