fix(files): stop rejecting ordinary HTML documents at the parser limits - #6446
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview
Tests pin the byte-cap rejection, the new token limit, a regression for large tables, and that Reviewed by Cursor Bugbot for commit c3e1373. Configure here. |
Greptile SummaryThe PR raises the HTML parser’s markup-token limit while retaining the existing byte limit, and reduces sanitizer allocation overhead without changing its established output behavior.
Confidence Score: 5/5The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issues identified. The parser retains its byte-level memory backstop, the expanded token boundary is covered by acceptance and rejection tests, and the sanitizer refactor preserves the previous character-removal set without leaving repository consumers of the deleted helpers.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/file-parsers/html-parser.ts | Raises the token cap with documented memory measurements while preserving the 32 MiB input backstop. |
| apps/sim/lib/file-parsers/html-parser.test.ts | Updates boundary fixtures and adds coverage proving that a realistic large table is accepted. |
| apps/sim/lib/file-parsers/utils.ts | Replaces equivalent chained sanitizer passes with one combined character class and removes unused exports. |
| apps/sim/lib/file-parsers/utils.test.ts | Adds coverage for invalid-character removal, preserved whitespace, ordinary Unicode, and established surrogate handling. |
Reviews (1): Last reviewed commit: "fix(files): stop rejecting ordinary HTML..." | Re-trigger Greptile
The markup-token cap rejected a 30,000-row table export at 3.6 MB. Doubled it to a value measured safe, and left the byte cap where it is - that one is load-bearing, so the reasoning is now recorded alongside it.
c3e1373 to
a1dbb18
Compare
Summary
Follow-up to #6423, which set the HTML parser's markup-token limit too tight.
Rebased on #6442, which fixed the sanitizer independently — the sanitizer and dead-helper changes that were in this PR are dropped in favour of that one.
Type of Change
Testing
Added a regression test for the table export the old cap rejected, and re-verified the documented memory thresholds against the rebased tree.
bun run type-check,bun run lint, andcheck:api-validationclean; file-parsers and parse-route suites pass (118 tests).Checklist