Skip to content

Commit 3fd88b6

Browse files
committed
fix: disable non-functional FishFish websocket connection
The built-in WebSocket API doesn't support passing headers, so we can't authenticate to the FishFish websocket server. Hence this is disabled until we switch over to a websocket library that does allow us to pass headers.
1 parent 50376b1 commit 3fd88b6

1 file changed

Lines changed: 2 additions & 30 deletions

File tree

backend/src/data/FishFish.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,6 @@ async function fishFishApiCall(method: string, path: string, query: Record<strin
9494
return response.json();
9595
}
9696

97-
async function subscribeToFishFishUpdates(): Promise<void> {
98-
if (updatesWs) {
99-
return;
100-
}
101-
const sessionToken = await getSessionToken();
102-
console.log("[FISHFISH] Connecting to WebSocket for real-time updates");
103-
updatesWs = new WebSocket("wss://api.fishfish.gg/v1/stream", {
104-
headers: {
105-
Authorization: sessionToken,
106-
},
107-
});
108-
updatesWs.addEventListener("open", () => {
109-
console.log("[FISHFISH] WebSocket connection established");
110-
});
111-
updatesWs.addEventListener("message", (event) => {
112-
console.log("[FISHFISH] ws update:", event.data);
113-
});
114-
updatesWs.addEventListener("error", (error) => {
115-
console.error(`[FISHFISH] WebSocket error: ${error.message}`);
116-
});
117-
updatesWs.addEventListener("close", () => {
118-
console.log("[FISHFISH] WebSocket connection closed, reconnecting after delay");
119-
updatesWs = null;
120-
setTimeout(() => {
121-
subscribeToFishFishUpdates();
122-
}, WS_RECONNECT_DELAY);
123-
});
124-
}
125-
12697
async function refreshFishFishDomains() {
12798
const rawData = await fishFishApiCall("GET", "domains", { full: "true" });
12899
const parseResult = z.array(zDomain).safeParse(rawData);
@@ -167,7 +138,8 @@ export async function initFishFish() {
167138
}
168139

169140
await refreshFishFishDomains();
170-
void subscribeToFishFishUpdates();
141+
// Real-time updates disabled until we switch to a WebSocket lib that supports authorization headers
142+
// void subscribeToFishFishUpdates();
171143
setInterval(() => refreshFishFishDomains(), FULL_REFRESH_INTERVAL);
172144
}
173145

0 commit comments

Comments
 (0)