Skip to content

Main convert - #402

Merged
abbaseya merged 6 commits into
mainfrom
main-convert
Jun 5, 2026
Merged

Main convert#402
abbaseya merged 6 commits into
mainfrom
main-convert

Conversation

@abbaseya

@abbaseya abbaseya commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

abbaseya and others added 4 commits June 5, 2026 18:56
…ient

determineRuntime() equated 'no window' with server-side, so the signals Web
Worker fell into 'server-with-fetch' and the ConvertAgent User-Agent
announcement (meant for server-side SDK traffic only) ran inside real
browsers. The resulting custom header forced a CORS preflight the signals
endpoint rejects, breaking every signals worker upload and driving the WAF
retry storm. Browser worker scopes are now detected via importScripts, which
server runtimes (Node.js) and edge runtimes (Cloudflare Workers) do not
expose, so those keep announcing ConvertAgent as intended.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Empty release commit so @convertcom/js-sdk ships a new version carrying the
patched @convertcom/js-sdk-utils dependency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
typeof null is 'object', so a mocked environment defining self = null passed
the typeof guard and the importScripts access would throw. Optional chaining
degrades it to undefined and falls through to the server checks, matching the
file's existing navigator?.sendBeacon idiom.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d-as-server

fix(utils): classify browser Web Workers as browser runtime in HttpClient
@abbaseya
abbaseya requested a review from a team June 5, 2026 17:27
@abbaseya abbaseya self-assigned this Jun 5, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the runtime determination logic in packages/utils/src/http-client.ts to correctly identify Browser Web Workers as a browser runtime by checking for the presence of self.importScripts. This prevents Web Workers from incorrectly falling back to a server-side runtime, which previously caused CORS preflight failures on signals uploads. There are no review comments, and I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

@abbaseya
abbaseya merged commit acb2943 into main Jun 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants