Skip to content

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

Description

@Peter-Petrik

Server version: 2.32.0 (Raspberry Pi 5, Bookworm, Node per the install). Data connection: type "Signal K", source "TCP" (client), host 127.0.0.1, port 3009, connecting to a local ndjson delta source that is already listening.

On every server start the connection logs

Reconnect 127.0.0.1 3009 retry 0 delay 100

and ~100 ms later reports "Connected to 127.0.0.1 3009". The first line is emitted from the reconnect handler in packages/streams/src/tcp.ts (around line 133), which calls app.setProviderError(...) for every attempt the reconnect wrapper schedules — including attempt 0, the initial connect. So a data connection that connects cleanly on the first try still records a provider error at each startup, and the entry survives in the log after the status has been overwritten by the connect handler's setProviderStatus.

Expected: attempt 0 is not an error condition; only retries (n > 0), disconnect and error should go through setProviderError. Suggested change: in the reconnect handler, route n === 0 to setProviderStatus (or skip it) and leave n > 0 as is. Happy to open a PR with that one-line change if you'd prefer.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions