Skip to content

πŸ› fix(api): report the real server version in portwing WS welcome frames#553

Merged
scttbnsn merged 2 commits into
dev/v1.6from
feat/v1.6-portwing-welcome-version
Jul 17, 2026
Merged

πŸ› fix(api): report the real server version in portwing WS welcome frames#553
scttbnsn merged 2 commits into
dev/v1.6from
feat/v1.6-portwing-welcome-version

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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 as 1.5.0 to agents. The documented Welcome example was describing intended behavior the code never delivered.

Fix: drydockVersion() now delegates to the canonical getVersion() from app/configuration (DD_VERSION override, else package.json β€” the same source app/debug/dump.ts and the rest of the API use), still cached at first read and still overridable by injectDrydockVersionForTesting(). 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 with expected '1.5.0' to be '9.9.9-test'; 98/98 file tests green post-fix, portwing-ws.ts at 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

  • Portwing WebSocket Welcome frames now report the canonical server version (no more hard-coded 1.5.0).
  • drydockVersion() delegates to the canonical getVersion() from app/configuration (honors DD_VERSION override or package.json fallback) while keeping first-read caching and the existing injectDrydockVersionForTesting() override.
  • Updated [1.6.0-rc.2] changelog entry to reflect the Portwing WS welcome-version fix.

πŸ”§ Changed

  • Added/extended regression coverage: mock getVersion() and assert the first outbound welcome frame contains data.config.drydockVersion equal to the mocked value during a full upgrade + hello handshake.
  • Replaced scheduler-sensitive fixed delay in the welcome-version regression test with vi.waitFor.
  • Refreshed related comments and configuration imports around the version source.

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.
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drydock-website Ready Ready Preview, Comment Jul 17, 2026 7:30am
drydockdemo-website Ready Ready Preview, Comment Jul 17, 2026 7:30am

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 566df043-8223-4f3a-87be-a916bc5b3600

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 52c4534 and 102a10c.

πŸ“’ Files selected for processing (1)
  • app/api/portwing-ws.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/api/portwing-ws.test.ts

πŸ“ Walkthrough

Walkthrough

The WebSocket gateway now obtains its cached drydockVersion from getVersion() instead of a hardcoded value. The test configuration mocks getVersion() to return 9.9.9-test, and a new handshake test verifies that the welcome frame contains this version.

πŸš₯ Pre-merge checks | βœ… 2
βœ… Passed checks (2 passed)
Check name Status Explanation
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v1.6-portwing-welcome-version

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 42a1a2f and 52c4534.

β›” Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
πŸ“’ Files selected for processing (2)
  • app/api/portwing-ws.test.ts
  • app/api/portwing-ws.ts

Comment thread app/api/portwing-ws.test.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.
@scttbnsn
scttbnsn merged commit 174d62c into dev/v1.6 Jul 17, 2026
4 of 5 checks passed
@scttbnsn
scttbnsn deleted the feat/v1.6-portwing-welcome-version branch July 17, 2026 07:30
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.

1 participant