Skip to content

fix!: keep URL path, query and fragment casing in the default unique_key - #2371

Merged
vdusek merged 3 commits into
v2from
fix/normalize-url-casing
Oct 31, 2026
Merged

vdusek merged 3 commits into
v2from
fix/normalize-url-casing

Conversation

@vdusek

@vdusek vdusek commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

normalize_url lowercased the whole URL, so URLs that differ only in path or query casing (/Product/ABC and /product/abc) got the same default unique_key, and the crawler silently skipped one of them. It now lowercases only the scheme and host, which are the only case-insensitive parts per RFC 3986. This is the same as normalizeUrl in Crawlee JS.

Breaking, because default unique keys change for URLs with uppercase characters in the path, query or fragment. The v2 upgrade guide covers it, including how to keep case-insensitive deduplication.

Closes: #2008

✍️ Drafted by Claude Code

@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label 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.
⚠️ Please upload report for BASE (v2@6d6aceb). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v2    #2371   +/-   ##
=====================================
  Coverage      ?   94.31%           
=====================================
  Files         ?      187           
  Lines         ?    13838           
  Branches      ?        0           
=====================================
  Hits          ?    13051           
  Misses        ?      787           
  Partials      ?        0           
Flag Coverage Δ
unit 94.31% <100.00%> (?)

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 15:34

@apify-factory apify-factory 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.

Looks good, nothing blocking.

🏭 Factory review — ℹ️ not auto-approved

This change was reviewed but cannot be auto-approved: a gate failed, so the review cannot end in an approval.

check result
Static gates ❌ 13/16 — base-branch, file-extensions, pr-title
Review findings ✅ none
Reviewer escalation ❌ Intentional breaking change to the default Request.unique_key (a public deduplication contract), which affects requests already persisted in existing request queues.
Juror 1 — claude-sonnet-5-5, adversarial ⏭️ skipped — a gate failed
Why it was not auto-approved

Failed gates:

  • base-branch: base is v2, required master
  • file-extensions: disallowed extension: docs/introduction/03_adding_more_urls.mdx
  • pr-title: breaking changes are never 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 9a70beeb6 · workflow run

@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 added a commit that referenced this pull request Oct 31, 2026
…on reuse (#2373)

Two tests added in #2349 fail intermittently in CI (seen on #2371).

- `test_closing_unread_response_reuses_connection[impit]`: impit returns
a drained connection to its pool in the background, so the request sent
right after a close sometimes opens a second connection. Under load this
failed in 2 of 120 local runs. The test now allows up to two
connections. A working client opens 1 or 2, and one that drops the
connections of closed responses always opens 3 (300 runs each), so the
test still catches that regression.
- `test_read_again_after_timeout[httpx]`: the 200 ms timeout covered the
whole request, and the slow macOS runner didn't get the headers in time.
The test now uses a 10 s timeout and moves the event loop clock past the
deadline before the second `read()`, so it doesn't wait on the wall
clock.

Both tests still fail when the behavior they cover is broken. After the
change, 1,440 runs under load passed.

*✍️ Drafted by Claude Code*
@vdusek
vdusek merged commit a65cd99 into v2 Oct 31, 2026
37 checks passed
@vdusek
vdusek deleted the fix/normalize-url-casing branch October 31, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

normalize_url lowercases the entire URL, silently deduplicating case-distinct pages

3 participants