fix(rivetkit): skip User-Agent header on browser fetches#4980
Conversation
|
🚅 Deployed to the rivet-pr-4980 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR #4980 Code ReviewOverviewThis PR bundles three distinct fixes into a release-candidate bump from 2.2.1 to 2.2.2-rc.1:
The bulk of the diff (190+ lines) is version bumps across package manifests. Fix 1: User-Agent header skipped in browser environmentsFiles: What changed:
Browser detection heuristic:
Cache pattern concern: The three-state sentinel ( No tests added. A unit test mocking Fix 2: Replace
|
| Area | Severity | Finding |
|---|---|---|
httpUserAgent() browser detection |
Low | typeof document heuristic is correct; edge cases (Workers) behave as intended |
| Three-state cache pattern | Low | Works correctly but slightly indirect; explicit null branch would be clearer |
| No test for browser UA suppression | Medium | A unit test mocking document would prevent regressions |
DOMAIN_REGEX single-label match |
Low | Bare hostnames pass; acceptable given localhost is already short-circuited |
Zod pinned to exact 3.24.4 |
Low | Intentional workaround; should be un-pinned once Vite compat is resolved |
| PR description is empty template | Info | The body is the default PR template with no description of what was fixed or why |
The core logic changes are correct and address real browser-compatibility and build-breaking bugs. Main actionable gaps: (1) add a unit test for httpUserAgent() browser suppression to prevent regressions, and (2) fill out the PR description to explain the three distinct fixes and their root causes.

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: