fix: Report the package version in the SDK user agent - #460
fix: Report the package version in the SDK user agent#460devin-ai-integration[bot] wants to merge 1 commit into
Conversation
The VERSION constant used for the WorkOS appInfo user-agent tag was hardcoded to '2.14.0' and never updated, so every release (through v4.3.0) reported authkit/nextjs: 2.14.0 in telemetry regardless of the installed version. Set it to the real version, annotate it for release-please so future releases bump it automatically, and add a test asserting it stays in sync with package.json. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Original prompt from heather
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR fixes a long-standing bug where the
Confidence Score: 5/5Safe to merge — the only runtime change is the version string reported in outbound user-agent headers, and the automation wired in here ensures that string stays correct on every future release. All three files touch only version-reporting infrastructure: a corrected constant value, a release-please config entry, and a new regression test. The test's path resolution via import.meta.url is appropriate for this ESM project. No business logic, auth flows, or data paths are affected. No files require special attention. Important Files Changed
|
Summary
The
VERSIONconstant that feeds the WorkOSappInfouser-agent tag was hardcoded and never updated with releases:That literal is still
'2.14.0'in the published4.0.0,4.1.0,4.2.0, and4.3.0tarballs, so every install reportsauthkit/nextjs: 2.14.0in outbound requests regardless of the actual version. This makes SDK-version telemetry unusable for support/debugging — you can't tell v2 from v4 by the tag (only by the peer@workos-inc/nodemajor, and even that tag is dropped entirely by workos-node 10.x's user agent).Fix:
VERSIONto the real version and annotate it so release-please bumps it on every release:package.json:VERSION === package.json.versionso the constant can't silently drift again.No runtime behavior changes beyond the reported version string.
Test plan
pnpm test— 401 tests pass, including the newreports the package version in the user agentassertion.pnpm run typecheck,pnpm run lint,pnpm run format:check— clean.pnpm run build— compileddist/esm/workos.jsnow emitsexport const VERSION = '4.3.0';.package.jsonand the annotated line insrc/workos.tsin the same commit.Link to Devin session: https://app.devin.ai/sessions/5afb843db1f54e38ae15250a1563b83a