Repository navigation
fix(observability): read JSONWP session caps for platform and browser version [v10] - #409
AakashHotchandani wants to merge 3 commits into
Conversation
… version [v10] Port of #377 (v9) / #374 (v8) to main. Sessions that negotiate the JSONWP dialect (e.g. Chrome 87 on Automate) return `platform`/`version` instead of `platformName`/`browserVersion`, so TRA showed the OS and browser version as "Unknown". getSessionPlatformName/getSessionBrowserVersion fall back to the JSONWP keys, and platform_version falls back to the requested capabilities. SDK-8256 (group 7416391) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
RUN_TESTS |
|
[SDK Wdio Test] TRA build state: failed | Stability 83% — verdict: failure. Passed: 48, Failed: 10, Aggregate: 58. TRA: https://observability.browserstack.com/builds/jprnedneen4aewxfvlpajtx6ez5k42w9gnfhyfir |
|
✅ Good to go — no blocking findings; 2 💡 suggestions below.
💡 Suggestions (non-blocking)S1 — Duplicate changeset. S2 — Verified
Change map (generated deterministically from the diff)graph LR
subgraph nwdio_service["wdio-service"]
npackages_browserstack_service_src_reporter_ts["reporter.ts<br/>~19 lines"]
npackages_browserstack_service_src_util_ts["util.ts<br/>~19 lines"]
npackages_browserstack_service_tests_util_test_ts["util.test.ts<br/>~19 lines"]
npackages_browserstack_service_src_insights_handler_ts["⚠ insights-handler.ts<br/>~14 lines"]
npackages_browserstack_service_tests_insights_handler_test_ts["⚠ insights-handler.test.ts<br/>~14 lines"]
n_changeset_jsonwp_session_caps_v10_md["jsonwp-session-caps-v10.md<br/>~5 lines"]
n_changeset_pr_409_md["pr-409.md<br/>~5 lines"]
end
↻ This verdict comment is the review anchor — it's updated in place on each run (the gate posts its status separately). — SDK PR Review Agent |
pr-409.md is auto-generated from the PR template by changeset-from-pr.yml and is byte-identical; keeping both would duplicate the CHANGELOG entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What is this about?
Port of #377 (v9) and #374 (v8) to
main(the v10 line). 10.0.0 / 10.0.1 were released without the fix.For sessions that negotiate the JSONWP dialect, the test-run integrations carry no OS name and no browser version. Chrome 87 on Automate is one such case. TestHub then stores
cbt_platform"Unknown," andcbt_browser"Chrome,Unknown", and TRA flags the build undermetadata_issue_non_timeout.Cause: a JSONWP session returns
platform: 'WINDOWS'andversion: '87.0.4280.66', with noplatformNameorbrowserVersion. Both integration builders read only the W3C keys:InsightsHandlerTestReporterThe OS version can also be lost, because
_userCapsmay already hold the session caps withoutbstack:options.Change (same as #377):
util.tshelpersgetSessionPlatformNameandgetSessionBrowserVersionfall back toplatformandversionwhen the W3C key is missing.browser.requestedCapabilities.The patch from #377 applied cleanly to
insights-handler.ts,reporter.tsandutil.tsonmain. Onlytests/util.test.tsneeded a manual merge: both sides append newdescribeblocks at the end of the file, and both are kept.Checks (local, Node 26;
.nvmrc22.23.4 also has zstd, Node 22.11 does not and fails to loadundici):npm run buildpasses (gRPC codegen, bundle,tsc -p tsconfig.prod.json).eslinton the changed files: clean.npm test):main(91c0e3b)util.test.ts(getSessionPlatformName/getSessionBrowserVersion), 2 ininsights-handler.test.ts(JSONWP caps;requestedCapabilitiesOS-version fallback). Withinsights-handler.ts/reporter.tsreverted tomain, bothinsights-handlercases fail (2 failed, 82 passed).main(same names:service,utilstopBuildUpstream/launchTestSession/uploadLogs/getAppA11yResults,funnelInstrumentation,crash-reporter,cliUtils,requestUtils,launcher). Onelaunchertest failed only on themainrun (flaky). The change adds no failures.End-to-end evidence (from #377): Automate, Windows 11 + Chrome 87, before
Unknown,Unknown/Chrome,Unknown(build98brwkbu0rs0pwindxxvbkhykbsrak68r0jm3z6x), afterWindows,11/Chrome,87(buildoogqmhsirwvhyrwoyxomftjfstewwasrmn9ruhvs). In production, group 7416391 has 0 flagged builds on 8.56.2 (v8 fix).Not verified:
Related Jira task/s
metadata_issue_non_timeout, group 7416391)Release (mandatory for every PR — required for the
ready-for-reviewlabel)Version bump: (required — tick exactly one)
Release notes type: (optional)
Release notes (customer-facing): (optional but encouraged)
Release notes (internal): (required — engineer-facing; what actually changed / why)
platform/versionwhenplatformName/browserVersionare absent, and torequestedCapabilitiesfor the OS version.Checklist
PR Validations
Run Tests: Comment RUN_TESTS to trigger sanity tests.
🤖 Generated with Claude Code