Skip to content

fix(sitemap): join element text once and reject entity declarations - #2369

Merged
vdusek merged 1 commit into
masterfrom
fix/sitemap-element-text
Oct 30, 2026
Merged

vdusek merged 1 commit into
masterfrom
fix/sitemap-element-text

Conversation

@vdusek

@vdusek vdusek commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

The XML sitemap handler appended every characters() callback to a string. Expat can split one text node into many callbacks, so assembling a long <loc> took quadratic time. The handler now collects the pieces in a list and joins them once in endElement.

Sitemaps never declare entities, so the XML parser now rejects entity declarations. Such a sitemap is logged as a parse failure and yields no URLs.

✍️ Drafted by Claude Code

@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Oct 30, 2026
@vdusek vdusek self-assigned this Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.11%. Comparing base (5f91c27) to head (32e0ccf).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2369      +/-   ##
==========================================
- Coverage   94.14%   94.11%   -0.04%     
==========================================
  Files         184      184              
  Lines       13647    13654       +7     
==========================================
+ Hits        12848    12850       +2     
- Misses        799      804       +5     
Flag Coverage Δ
unit 94.11% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek marked this pull request as ready for review October 30, 2026 09:51
@vdusek
vdusek requested review from Mantisus and Pijukatel October 30, 2026 09:51
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 30, 2026

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring approval from @Mantisus.

@vdusek
vdusek requested a review from apify-factory October 30, 2026 12:31

@apify-factory apify-factory left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nothing blocking.

🏭 Factory review — ℹ️ not auto-approved

This change was reviewed but cannot be auto-approved: a human review is active (Mantisus: APPROVED, apify-approval-mirror[bot]: APPROVED).

check result
Static gates ✅ 16/16
Review findings ✅ none
Reviewer escalation ❌ The change adds input-validation hardening to the parser for untrusted sitemap XML, and now rejects whole sitemaps that declare entities.
Juror 1 — claude-sonnet-5-5, adversarial ⏭️ skipped — the reviewer escalated
Why it was not auto-approved

The comments above are the review itself; this section only explains the approval decision. Push a change and request @apify-factory again to re-run it, or ask a human to review.

Reviewed 32e0ccf3d · workflow run

@vdusek
vdusek merged commit 242be00 into master Oct 30, 2026
52 of 53 checks passed
@vdusek
vdusek deleted the fix/sitemap-element-text branch October 30, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants