fix(python): share browser-string resolution across sync and async clients#481
Open
barjin wants to merge 1 commit into
Open
fix(python): share browser-string resolution across sync and async clients#481barjin wants to merge 1 commit into
barjin wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The sync and async Python clients each hand-maintained their own
browserstring → fingerprint match, and the two had drifted. The async client mappedchrome124to thechrome_125fingerprint (mislabeled, even though a realchrome_124fingerprint exists in the core database), while the sync client didn't recognizechrome124at all and fell back topanic!("Unsupported browser"), aborting across the FFI boundary instead of raising a catchable Python exception.This extracts the resolution into a single
fingerprint_by_namehelper that both clients call, so they can no longer diverge.chrome124now resolves to its realchrome_124fingerprint, the sync client gainschrome124support, and unknown browser strings raise aValueErrorin both clients. To surface that error the sync constructor return type changes fromResult<Self, ImpitPyError>toPyResult<Self>(with the oneno_clientmacro caller adjusted to match).The bare
chromealias is intentionally left atchrome_125in both clients to preserve current behavior and the pinned JA4 test.Closes #476