Skip to content

Handle bill text size limit (#2169)#2171

Draft
Smoss wants to merge 2 commits into
codeforboston:mainfrom
Smoss:2169-handle-bill-text-limit
Draft

Handle bill text size limit (#2169)#2171
Smoss wants to merge 2 commits into
codeforboston:mainfrom
Smoss:2169-handle-bill-text-limit

Conversation

@Smoss

@Smoss Smoss commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bills exceeding Firestore's 1 MiB limit (e.g. H5500, court 194) now scrape successfully: fetchBillResource in functions/src/bills/bills.ts moves oversized DocumentText into an ordered contentBlocks subcollection via functions/src/bills/contentBlocks.ts
  • Client-side: getBillDocumentText in components/db/bills.ts returns inline text for normal bills and reassembles blocks for chunked ones
  • UI: components/bill/Summary.tsx fetches lazily when the "View Bill" modal opens, showing a Bootstrap spinner while loading; the "View Bill" button is shown whenever DocumentText OR DocumentTextBlockCount is present

Closes #2169

Test plan

  • yarn test passes (functions unit tests cover all 4 storage cases: inline, chunked, write-failure fallback, stale-blocks cleanup; UI test covers chunked reassembly, inline, and no-text paths)
  • Normal bill (e.g. H1, court 194): "View Bill" button present, modal opens immediately with text
  • Oversized bill after backfill/scrape (H5500, court 194): "View Bill" button present, spinner shown briefly, then text appears

🤖 Generated with Claude Code

Smoss added 2 commits June 16, 2026 20:50
…. Introduced loading state and spinner for better user experience. Updated database functions to handle chunked document text storage in Firestore, ensuring bills exceeding size limits are properly managed. Added tests for document text storage behavior.
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
maple-dev Ready Ready Preview, Comment Jun 17, 2026 1:41am

Request Review

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.

Handle Bill Text Limit

1 participant