π fix(api): report the real server version in portwing WS welcome frames#553
Conversation
drydockVersion() claimed to read package.json at runtime but hard-coded '1.5.0' since the endpoint shipped in v1.5.0 β every welcome frame on v1.5.1/v1.5.2/v1.6.0-rc.1 identified the server as 1.5.0 to agents. It now delegates to the canonical getVersion() (DD_VERSION override, else package.json), still cached and still overridable by injectDrydockVersionForTesting(). Found by CodeRabbit on release PR #550 against the documented welcome example. π§ͺ TDD: regression test mocks getVersion() and asserts the welcome frame carries it (failed pre-fix expecting '9.9.9-test', received '1.5.0'); 98/98 file tests green post-fix. π CHANGELOG bullet under [1.6.0-rc.2] Fixed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: π Files selected for processing (1)
π§ Files skipped from review as they are similar to previous changes (1)
π WalkthroughWalkthroughThe WebSocket gateway now obtains its cached π₯ Pre-merge checks | β 2β Passed checks (2 passed)
β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
π€ Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/api/portwing-ws.test.ts`:
- Around line 347-350: Replace the fixed 10 ms timeout after
sendMessageToGateway in the websocket test with the gatewayβs message/event
completion signal or the existing bounded frame-wait helper. Ensure the welcome
frame is available before reading ws.sentMessages[0], while retaining a bounded
wait to avoid hanging tests.
πͺ Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3376ee25-ba9b-4fc0-9a3c-b57a914c4336
β Files ignored due to path filters (1)
CHANGELOG.mdis excluded by!CHANGELOG.md
π Files selected for processing (2)
app/api/portwing-ws.test.tsapp/api/portwing-ws.ts
CodeRabbit follow-up on PR #553: replace the fixed 10 ms sleep with vi.waitFor so the welcome read isn't scheduler-dependent under CI load.
Fixes the shipped bug CodeRabbit caught on release PR #550 (the finding):
drydockVersion()claimed to be populated from package.json at runtime but hard-coded'1.5.0'β every portwing WS Welcome frame since the endpoint shipped in v1.5.0 (so v1.5.1, v1.5.2, and v1.6.0-rc.1 servers) identified itself as1.5.0to agents. The documented Welcome example was describing intended behavior the code never delivered.Fix:
drydockVersion()now delegates to the canonicalgetVersion()fromapp/configuration(DD_VERSIONoverride, else package.json β the same sourceapp/debug/dump.tsand the rest of the API use), still cached at first read and still overridable byinjectDrydockVersionForTesting(). Stale comments corrected.TDD (Codex tests first): new regression test mocks
getVersion()to a sentinel and asserts the Welcome frame carries it β failed pre-fix withexpected '1.5.0' to be '9.9.9-test'; 98/98 file tests green post-fix,portwing-ws.tsat 100/100/100/100.CHANGELOG bullet under
[1.6.0-rc.2]Fixed. Full pre-push gate green from a worktree; release-guard scripts 105/105.Changelog
π Fixed
1.5.0).drydockVersion()delegates to the canonicalgetVersion()fromapp/configuration(honorsDD_VERSIONoverride orpackage.jsonfallback) while keeping first-read caching and the existinginjectDrydockVersionForTesting()override.[1.6.0-rc.2]changelog entry to reflect the Portwing WS welcome-version fix.π§ Changed
getVersion()and assert the first outboundwelcomeframe containsdata.config.drydockVersionequal to the mocked value during a full upgrade + hello handshake.vi.waitFor.