Skip to content

fix(python): share browser-string resolution across sync and async clients#481

Merged
barjin merged 2 commits into
masterfrom
fix/python-browser-string-drift
Jun 16, 2026
Merged

fix(python): share browser-string resolution across sync and async clients#481
barjin merged 2 commits into
masterfrom
fix/python-browser-string-drift

Conversation

@barjin

@barjin barjin commented Jun 12, 2026

Copy link
Copy Markdown
Member

The sync and async Python clients each hand-maintained their own browser string → fingerprint match, and the two had drifted. The async client mapped chrome124 to the chrome_125 fingerprint (mislabeled, even though a real chrome_124 fingerprint exists in the core database), while the sync client didn't recognize chrome124 at all and fell back to panic!("Unsupported browser"), aborting across the FFI boundary instead of raising a catchable Python exception.

This extracts the resolution into a single fingerprint_by_name helper that both clients call, so they can no longer diverge. chrome124 now resolves to its real chrome_124 fingerprint, the sync client gains chrome124 support, and unknown browser strings raise a ValueError in both clients. To surface that error the sync constructor return type changes from Result<Self, ImpitPyError> to PyResult<Self> (with the one no_client macro caller adjusted to match).

The bare chrome alias is intentionally left at chrome_125 in both clients to preserve current behavior and the pinned JA4 test.

Closes #476

…ients

The sync and async clients each hand-maintained their own browser-string to
fingerprint match, which had drifted: async mapped `chrome124` to the chrome_125
fingerprint (mislabeled) while sync lacked `chrome124` entirely and panicked
across the FFI boundary on any unknown browser instead of raising a catchable
exception. Extract a single `fingerprint_by_name` helper used by both clients so
they can no longer diverge, map `chrome124` to its real chrome_124 fingerprint,
and return a `ValueError` for unknown browsers.

Closes #476
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 12, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Jun 12, 2026
maturin 1.14.0 rejects the experimental free-threaded 3.13 interpreter; free-threaded builds are only supported from Python 3.14.
@barjin barjin requested a review from Pijukatel June 15, 2026 09:39
@barjin barjin merged commit 195a7a1 into master Jun 16, 2026
27 checks passed
@barjin barjin deleted the fix/python-browser-string-drift branch June 16, 2026 07:35
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.

(py) Browser-string match drift: 'chrome124' maps to chrome_125 in async but panics in sync client

3 participants