Skip to content

Commit b57afe0

Browse files
t3dotggnick-pottsclaude
committed
docs(client): say why a refocus does not resubscribe
An inactive app keeps running, so a refocus never suspended the socket and its streams are still live. The wakeup comment no longer calls the inactive state brief, since a call can keep the app inactive for minutes. Co-authored-by: Nick <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f79ea35 commit b57afe0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎packages/client-runtime/src/connection/wakeups.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export type ConnectionWakeup =
66
| "application-active"
77
| "application-active-probe"
88
| "application-active-reconnect"
9-
// The app came back from a brief inactive state, such as Control Center or
10-
// Face ID, without being suspended. Its socket is fine, but a pending retry
11-
// should still run now.
9+
// The app came back from an inactive state, such as Control Center or Face
10+
// ID, without a background visit. Inactive apps keep running, so the socket
11+
// was never suspended, but a pending retry should still run now.
1212
| "application-refocused"
1313
| "credentials-changed"
1414
// The device moved to a different network (another Wi-Fi, Wi-Fi to
@@ -30,6 +30,7 @@ export function resetsRetryBackoff(reason: ConnectionWakeup): boolean {
3030
}
3131

3232
// A long resume replaces the session, and the new session subscribes on its own.
33+
// A refocus never suspended the socket, so its streams are still live.
3334
export function shouldResubscribeAfterWakeup(reason: ConnectionWakeup): boolean {
3435
return reason === "application-active" || reason === "application-active-probe";
3536
}

0 commit comments

Comments
 (0)