Skip to content
This repository was archived by the owner on Jul 17, 2024. It is now read-only.

Commit 22723da

Browse files
committed
Change ts-client-sdk to branch debug_reconnect
1 parent 57fd63b commit 22723da

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

assets/package-lock.json

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@fishjam-dev/react-client": "github:fishjam-dev/react-client-sdk#reconnet-on-network-change",
15+
"@fishjam-dev/ts-client": "github:fishjam-dev/ts-client-sdk#debug_reconnect",
1516
"@mediapipe/tasks-vision": "^0.10.12",
1617
"axios": "^1.6.8",
1718
"chartist": "^1.3.0",

assets/src/features/streaming/StreamingErrorBoundary.tsx

+20-20
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,22 @@ export const StreamingErrorBoundary: FC<PropsWithChildren> = ({ children }) => {
6767
}, 2000);
6868
};
6969

70-
const onSocketError: ClientEvents<PeerMetadata, TrackMetadata>["socketError"] = (error: Event) => {
71-
console.warn(error);
72-
handleError(`Socket error occurred.`, "onSocketError");
73-
};
74-
75-
const onConnectionError: ClientEvents<PeerMetadata, TrackMetadata>["connectionError"] = (error, client) => {
76-
if (client.isReconnecting()) {
77-
console.log("%c" + "During reconnection: connectionError %o", "color:gray", {
78-
error,
79-
iceConnectionState: error?.event?.target?.["iceConnectionState"]
80-
});
81-
} else {
82-
console.warn({ error, state: error?.event?.target?.["iceConnectionState"] });
83-
handleError(`Connection error occurred. ${error?.message ?? ""}`);
84-
}
85-
};
70+
// const onSocketError: ClientEvents<PeerMetadata, TrackMetadata>["socketError"] = (error: Event) => {
71+
// console.warn(error);
72+
// handleError(`Socket error occurred.`, "onSocketError");
73+
// };
74+
75+
// const onConnectionError: ClientEvents<PeerMetadata, TrackMetadata>["connectionError"] = (error, client) => {
76+
// if (client.isReconnecting()) {
77+
// console.log("%c" + "During reconnection: connectionError %o", "color:gray", {
78+
// error,
79+
// iceConnectionState: error?.event?.target?.["iceConnectionState"]
80+
// });
81+
// } else {
82+
// console.warn({ error, state: error?.event?.target?.["iceConnectionState"] });
83+
// handleError(`Connection error occurred. ${error?.message ?? ""}`);
84+
// }
85+
// };
8686

8787
const onJoinError: ClientEvents<PeerMetadata, TrackMetadata>["joinError"] = (event) => {
8888
console.log(event);
@@ -110,8 +110,8 @@ export const StreamingErrorBoundary: FC<PropsWithChildren> = ({ children }) => {
110110
client.on("reconnected", onReconnected);
111111
client.on("reconnectionRetriesLimitReached", onReconnectionRetriesLimitReached);
112112

113-
client.on("socketError", onSocketError);
114-
client.on("connectionError", onConnectionError);
113+
// client.on("socketError", onSocketError);
114+
// client.on("connectionError", onConnectionError);
115115
client.on("joinError", onJoinError);
116116
client.on("authError", onAuthError);
117117
client.on("socketClose", onSocketClose);
@@ -121,8 +121,8 @@ export const StreamingErrorBoundary: FC<PropsWithChildren> = ({ children }) => {
121121
client.off("reconnected", onReconnected);
122122
client.off("reconnectionRetriesLimitReached", onReconnectionRetriesLimitReached);
123123

124-
client.off("socketError", onSocketError);
125-
client.off("connectionError", onConnectionError);
124+
// client.off("socketError", onSocketError);
125+
// client.off("connectionError", onConnectionError);
126126
client.off("joinError", onJoinError);
127127
client.off("authError", onAuthError);
128128
client.off("socketClose", onSocketClose);

0 commit comments

Comments
 (0)