Skip to content

Commit 48b9018

Browse files
Call out DISCONNECTED behavior change with version-anchored alerts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent af6b341 commit 48b9018

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

docs/build-apps/concepts/how-apps-connect.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ When the network drops, the SDK reconnects automatically with exponential backof
6969
- `reconnectMaxWait` — default `Number.POSITIVE_INFINITY`, the maximum time between retries
7070
- `noReconnect` — default `false`, set to `true` to disable reconnection
7171

72-
Reconnection is transparent to your application code. The `RobotClient` object stays valid across the drop, and in-flight method calls throw errors that your app can catch and retry after the reconnection completes. While the SDK is retrying, it emits the `RECONNECTING` event; if all retries are exhausted, it emits `RECONNECTION_FAILED` with `error` and `attempts` fields.
72+
Reconnection is transparent to your application code. The `RobotClient` object stays valid across the drop, and in-flight method calls throw errors that your app can catch and retry after the reconnection completes. While the SDK is retrying, it emits `RECONNECTING`. If retries are exhausted, it emits `RECONNECTION_FAILED`.
73+
74+
{{< alert title="Behavior change" color="caution" >}}
75+
In versions of the Viam TypeScript SDK prior to v0.69.0, `DISCONNECTED` fired on any drop.
76+
From v0.69.0 onward, it fires only on intentional close or when `noReconnect` is set; transient drops emit `RECONNECTING`.
77+
{{< /alert >}}
7378

7479
What does _not_ happen automatically is your app's UI state. If you were showing a camera stream when the network dropped, the stream stops, and your UI has to rebuild the stream when the connection returns. If you were polling a sensor, the polling stops, and your UI has to resume polling. The SDK reconnects the transport; your app reconnects its own state.
7580

docs/build-apps/tasks/handle-connection-state.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ Show a connection status indicator in your app, react to connection events, and
1212

1313
For an explanation of how the SDK reconnects under the hood, see [Connection model](/build-apps/concepts/how-apps-connect/#reconnection).
1414

15+
{{< alert title="Behavior change" color="caution" >}}
16+
In versions of the Viam TypeScript SDK prior to v0.69.0, `DISCONNECTED` fired on any connection drop, including transient network interruptions.
17+
From v0.69.0 onward, `DISCONNECTED` fires only on intentional close or when `noReconnect` is set.
18+
Transient drops emit `RECONNECTING` instead, followed by `CONNECTED` on success or `RECONNECTION_FAILED` when retries are exhausted.
19+
20+
If your app listens for `DISCONNECTED` to detect network drops, listen for `RECONNECTING` instead.
21+
{{< /alert >}}
22+
1523
## Prerequisites
1624

1725
- A project with an active machine connection (see [Connect to a machine](/build-apps/tasks/connect-to-machine/))

0 commit comments

Comments
 (0)