fix(sdks): forward recordSession in browser-create (JS + Python) - #4590
Open
soroush5 wants to merge 1 commit into
Open
fix(sdks): forward recordSession in browser-create (JS + Python)#4590soroush5 wants to merge 1 commit into
soroush5 wants to merge 1 commit into
Conversation
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.
I noticed the API supports
recordSessiononPOST /v2/browser(wired through to the browser service asrecord), but the JS and Python SDKs had no way to send it — sessions created from either SDK are always recorded.What I changed:
recordSessiontobrowser()args and the request payload insrc/v2/methods/browser.ts(left unset by default so the server default still applies).record_sessiontobrowser()in the sync + async method modules and both client wrappers, sent asrecordSession.Tests I ran:
recordSession: falseis forwarded and that the key is omitted when unset:src/__tests__/unit/v2/browser-record-session.unit.test.ts(jest, 2 passed) andapps/python-sdk/tests/test_browser_record_session.py(pytest, 3 passed).threat-protection,scrape— both fail identically on the clean tree); Pythontests/shows the same 13 pre-existing failures before and after my change, with my 3 new tests passing.tsc --noEmitreports only pre-existing errors in files I didn't touch.No config, migration, or deployment impact — purely additive optional params.
Fixes #4589
Summary by cubic
Fixes
#4589— addsrecordSessionto browser-create in the JS and Python SDKs. Sessions created from either SDK were always recorded because the API'srecordSessionoption was never sent; now the SDKs pass it through, and callers who omit it still get the server's default.recordSessionarg onbrowser()is forwarded to the request body.record_sessionarg added to sync and asyncbrowser()methods, sent asrecordSession.recordSession: falseis forwarded and the key is omitted when unset.Written for commit 54e1af3. Summary will update on new commits.