You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Entity map: relative @id refs expand per page without a cap (refs and entity_edges rows can exceed SQLite limits) #2135
Found while reviewing release batch 2 (#2132, pub#1956 entity map storage).
A relative JSON-LD @id reference (e.g. {"@id":"#n"}) expands to the full page URL before it is stored. One page with 300 KB of JSON-LD (20k relative refs) on an 1,800-character URL produced a single 36.6 MB entity_map_pages.refs row, 122 times the input. At the 10 MiB body cap that is about 1.2 GB, past SQLite's maximum value length. saveEntityMap then throws, storeEntityMap swallows the error, and the crawl reads as having no entity map at all. entity_edges already stores the same expanded targets, so the exposure predates pub#1956; refs roughly doubles it. A hostile page can do this, so it is an audit-a-hostile-site robustness issue.
Also: sqlite.ts ~4610 JSON.parse(row.refs) is unguarded, so one corrupt row fails loadEntityMap for the whole crawl.
Acceptance Criteria
Per-page stored refs and entity edges are capped (e.g. 1,000 sorted keys plus a total count), with the cap noted in the stored data; a test with 20k relative refs on a long URL stores a bounded row
A page that exceeds the cap still gets an entity map for the crawl (the write does not fail as a whole)
A corrupt refs row is skipped with a warning; it does not fail loadEntityMap for the crawl
Activity
fix(crawler): cap stored entity refs and edges, skip corrupt refs rows …
docs(changelog): entry for entity ref and edge caps #2135
fix(crawler): cap stored entity refs and edges, skip corrupt refs rows …
Merge origin/main into boat/paste-inputs-auth-2106
Merge origin/main into boat/issues-cloud-only-2031