Skip to content

fix: report first TCP connection attempt as status, not error - #3024

Open
Peter-Petrik wants to merge 1 commit into
SignalK:masterfrom
Peter-Petrik:fix/tcp-first-attempt-not-error
Open

fix: report first TCP connection attempt as status, not error#3024
Peter-Petrik wants to merge 1 commit into
SignalK:masterfrom
Peter-Petrik:fix/tcp-first-attempt-not-error

Conversation

@Peter-Petrik

@Peter-Petrik Peter-Petrik commented Sep 9, 2026

Copy link
Copy Markdown

Fixes #3023.

The TCP client provider's reconnect handler routes every scheduled attempt through setProviderError, including attempt 0, the initial connect. A data connection that connects cleanly on the first try therefore logs "Reconnect retry 0 delay 100" as a provider error at every server start, before the connect handler overwrites the status.

This change reports attempt 0 via setProviderStatus and leaves retries (n > 0), disconnect and error unchanged.

Summary

Updates the TCP client reconnect handler to report the initial connection attempt (n === 0) with setProviderStatus.

Retry attempts continue to use setProviderError. This prevents successful initial connections from creating misleading provider error entries.

@github-actions github-actions Bot added the fix label Sep 9, 2026
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: bb793227-f3a3-4903-9451-af789de68bd1

📥 Commits

Reviewing files that changed from the base of the PR and between 0495a4a and 7c507e7.

📒 Files selected for processing (1)
  • packages/streams/src/tcp.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The TCP reconnect handler now reports the initial connection attempt as provider status. It reports subsequent retry attempts as provider errors.

Changes

TCP reconnect status reporting

Layer / File(s) Summary
Reconnect event classification
packages/streams/src/tcp.ts
When n === 0, the handler calls setProviderStatus. For later retries, it calls setProviderError.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 7c507

Initial TCP connection attempts are now reported as status rather than errors, while retries retain error reporting. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: reporting the first TCP connection attempt as status instead of an error.
Description check ✅ Passed The description clearly explains the problem, affected behavior, and intended fix. It does not include explicit testing details, but it is otherwise sufficiently complete and relevant.
Linked Issues check ✅ Passed The change satisfies issue #3023 by routing attempt 0 through setProviderStatus while preserving setProviderError for retries and other error conditions.
Out of Scope Changes check ✅ Passed The changes are limited to the TCP reconnect handler and directly address the linked issue. No unrelated changes are identified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TCP client data connection logs its first connection attempt as a provider error

1 participant