Skip to content

Commit f71190a

Browse files
committed
Explain why no real wss connection attempts atm
1 parent 34d0046 commit f71190a

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

src/shared/stores/operatorReachability.ts

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,30 +67,23 @@ const useOperatorReachabilityStore = create<{
6767
draft.pending = true
6868
})
6969

70-
let reachable = false
71-
72-
let ws: WebSocket | undefined
73-
74-
try {
75-
reachable = await new Promise<boolean>((resolve) => {
76-
/**
77-
* @todo Attempt the wss connections to the declared endpoints
78-
* for verification.
79-
*/
80-
resolve(tls && !!port && !!host && !isIPAddress(host))
81-
})
82-
} finally {
83-
ws?.close()
84-
85-
ws = undefined
70+
/**
71+
* StreamrClient opens many WebSocket connections, often hitting
72+
* browser limits.
73+
*
74+
* Since browsers handle this differently, it's hard to tell if
75+
* a failure is due to node issues or connection limits.
76+
*
77+
* @todo Let’s revisit this once we have a more reliable method for
78+
* confirming node reachability.
79+
*/
8680

87-
updateProbe(url, (draft) => {
88-
Object.assign(draft, {
89-
pending: false,
90-
reachable,
91-
})
81+
updateProbe(url, (draft) => {
82+
Object.assign(draft, {
83+
pending: false,
84+
reachable: tls && !!port && !!host && !isIPAddress(host),
9285
})
93-
}
86+
})
9487
},
9588
}
9689
})

0 commit comments

Comments
 (0)