Skip to content

fix(core): make skipNavigation request bookkeeping proxy-safe - #4099

Open
noahg9 wants to merge 2 commits into
apify:masterfrom
noahg9:fix/unproxied-request-bookkeeping
Open

fix(core): make skipNavigation request bookkeeping proxy-safe#4099
noahg9 wants to merge 2 commits into
apify:masterfrom
noahg9:fix/unproxied-request-bookkeeping

Conversation

@noahg9

@noahg9 noahg9 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

With skipNavigation, the request is wrapped in a Proxy whose loadedUrl getter throws. Internal request-queue bookkeeping reads the whole request and tripped that, so BasicCrawler worked around it by passing the original unproxied request as a separate argument.

The proxy now marks loadedUrl non-enumerable, so bookkeeping skips it while direct access still throws. That lets the normal request flow through, and the extra argument is removed.

skipNavigation wraps the request in a Proxy whose loadedUrl getter throws,
so internal request-queue bookkeeping (zod, spread, JSON) tripped it —
BasicCrawler worked around that by threading a separate unproxied request.

The proxy now reports loadedUrl as non-enumerable, so bookkeeping skips it
while direct access still throws. crawlingContext.request flows through
unchanged and the duplicate parameter is gone.

Closes apify#3526
@noahg9
noahg9 force-pushed the fix/unproxied-request-bookkeeping branch from 8e37c78 to b404725 Compare September 2, 2026 12:18
@janbuchar
janbuchar self-requested a review September 2, 2026 13:33
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.

Avoid passing unproxied request separately to internal methods

2 participants