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

Commit

Permalink
Change ts-client-sdk to branch debug_reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Rados13 committed Jun 21, 2024
1 parent 57fd63b commit 3faa5a4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
4 changes: 3 additions & 1 deletion assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"@fishjam-dev/react-client": "github:fishjam-dev/react-client-sdk#reconnet-on-network-change",
"@fishjam-dev/ts-client": "github:fishjam-dev/ts-client-sdk#debug_reconnect",
"@mediapipe/tasks-vision": "^0.10.12",
"axios": "^1.6.8",
"chartist": "^1.3.0",
Expand Down
32 changes: 16 additions & 16 deletions assets/src/features/streaming/StreamingErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@ export const StreamingErrorBoundary: FC<PropsWithChildren> = ({ children }) => {
}, 2000);
};

const onSocketError: ClientEvents<PeerMetadata, TrackMetadata>["socketError"] = (error: Event) => {
console.warn(error);
handleError(`Socket error occurred.`, "onSocketError");
};

const onConnectionError: ClientEvents<PeerMetadata, TrackMetadata>["connectionError"] = (error, client) => {
if (client.isReconnecting()) {
console.log("%c" + "During reconnection: connectionError %o", "color:gray", {
error,
iceConnectionState: error?.event?.target?.["iceConnectionState"]
});
} else {
console.warn({ error, state: error?.event?.target?.["iceConnectionState"] });
handleError(`Connection error occurred. ${error?.message ?? ""}`);
}
};
// const onSocketError: ClientEvents<PeerMetadata, TrackMetadata>["socketError"] = (error: Event) => {
// console.warn(error);
// handleError(`Socket error occurred.`, "onSocketError");
// };

// const onConnectionError: ClientEvents<PeerMetadata, TrackMetadata>["connectionError"] = (error, client) => {
// if (client.isReconnecting()) {
// console.log("%c" + "During reconnection: connectionError %o", "color:gray", {
// error,
// iceConnectionState: error?.event?.target?.["iceConnectionState"]
// });
// } else {
// console.warn({ error, state: error?.event?.target?.["iceConnectionState"] });
// handleError(`Connection error occurred. ${error?.message ?? ""}`);
// }
// };

const onJoinError: ClientEvents<PeerMetadata, TrackMetadata>["joinError"] = (event) => {
console.log(event);
Expand Down

0 comments on commit 3faa5a4

Please sign in to comment.