Title: lab-ops-hub: Worker fallback crawler buffers the whole response body — no 2 MB cap like the container · Issue #481 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: Worker fallback crawler buffers the whole response body — no 2 MB cap like the container · Issue #481 · developing-today/code
X Title: lab-ops-hub: Worker fallback crawler buffers the whole response body — no 2 MB cap like the container · Issue #481 · developing-today/code
Description: Problem crawlFallback (pkgs/lab-ops-hub/src/index.ts, the in-Worker fallback crawler) reads the crawl response with an unbounded await res.text() before slicing the result down to a 500-char excerpt / 20k-char text: const html = await re...
Open Graph Description: Problem crawlFallback (pkgs/lab-ops-hub/src/index.ts, the in-Worker fallback crawler) reads the crawl response with an unbounded await res.text() before slicing the result down to a 500-char excerp...
X Description: Problem crawlFallback (pkgs/lab-ops-hub/src/index.ts, the in-Worker fallback crawler) reads the crawl response with an unbounded await res.text() before slicing the result down to a 500-char excerp...
Opengraph URL: https://github.com/developing-today/code/issues/481
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: Worker fallback crawler buffers the whole response body — no 2 MB cap like the container","articleBody":"## Problem\n\n`crawlFallback` (pkgs/lab-ops-hub/src/index.ts, the in-Worker fallback crawler) reads the crawl response with an unbounded `await res.text()` before slicing the result down to a 500-char excerpt / 20k-char text:\n\n```ts\nconst html = await res.text();\n```\n\nThe container crawler it is the fallback for caps its read at 2,000,000 bytes (pkgs/lab-ops-hub/container/app.py: `res.read(2_000_000)`) — the two paths claim the \"same contract\" in the `crawlFallback` comment, but diverge on body size.\n\nAny validated public URL (or a validated public→public redirect chain, #460) that returns a huge body is therefore buffered whole in the Worker (128 MB memory limit): memory exhaustion / a failed crawl on a large page, where the container path truncates at 2 MB and succeeds.\n\nFound by the pr-diff-review lane as a REVIEW-FINDING in the sweep backlog (2026-10-21, PR #461 area — the `res.text()` line predates that PR, from PR #436); no open issue named it.\n\n## Fix\n\n- Read the fallback response body with a streaming cap of 2,000,000 bytes, matching the container's `res.read(2_000_000)` truncation semantics (truncate, don't throw), cancelling the stream once the cap is reached so the rest of the body is never buffered.\n- Put the capped reader in `src/lib.ts` (pure, Node-testable like the other crawl helpers) and use it from `crawlFallback`; UTF-8 decode must tolerate a multi-byte character split at the cap boundary (replacement character, matching the container's `errors=\"replace\"`).\n\n## Acceptance criteria\n\n- [ ] A response body larger than the cap is truncated to exactly the cap (in bytes) and the underlying stream is cancelled/not fully consumed.\n- [ ] A body under the cap is returned whole; a multi-byte character straddling the cap decodes with a replacement character instead of throwing.\n- [ ] The default cap equals the container's 2,000,000 bytes.\n- [ ] New tests in the TS suite cover the above; `npm test` (both suites, per #470) passes.\n\nSingle-repo: pkgs/lab-ops-hub exists only in developing-today/code.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-21T14:10:57Z","url":"https://github.com/developing-today/code/issues/481"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:384ac825-524e-6659-4460-64ccb8ed9d0d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C99C:C5B62:42F4FB:5A42D8:6B061EC8 |
| html-safe-nonce | c9e30f92fa5203b929f48ad16d7ff3d957f962aecaf4c7542dbecef86fb39ae4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTlDOkM1QjYyOjQyRjRGQjo1QTQyRDg6NkIwNjFFQzgiLCJ2aXNpdG9yX2lkIjoiNTYwMDcyNTk5MTAxOTY1MDc2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fb286d4202af4e8d31efff6010216102d7c4a785eef076d35b3a1ccacf372ae8 |
| hovercard-subject-tag | issue:5962189812 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/481/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3c15646f95b74a562e63d5f93359798bd9d6c955d3281e55e1871d74d93b7902/developing-today/code/issues/481 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c15646f95b74a562e63d5f93359798bd9d6c955d3281e55e1871d74d93b7902/developing-today/code/issues/481 |
| og:image:alt | Problem crawlFallback (pkgs/lab-ops-hub/src/index.ts, the in-Worker fallback crawler) reads the crawl response with an unbounded await res.text() before slicing the result down to a 500-char excerp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9a7c5824b75ea2ec5e3de73a483229c7bb9f32a774ffd401f010dd9bacf1483d |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b25c3080e84402f75431d8dc7a96b2635219cec7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width