fix: Applied fix for name, the oracle team sharing, sentinel client list visibility

This commit is contained in:
Sagnik
2026-04-19 17:07:12 +05:30
parent 269591a3cc
commit d886e4a669
20 changed files with 940 additions and 109 deletions

View File

@@ -167,7 +167,8 @@ export function connectPageSocket(
pageId: string,
handlers: {
onMessage: (msg: OracleWSMessage) => void;
onReconnect: () => void;
onReconnect?: () => void;
onOpen?: () => void;
onClose: () => void;
},
): () => void {
@@ -184,6 +185,10 @@ export function connectPageSocket(
function connect() {
ws = new WebSocket(`${wsBase}/ws/oracle/canvas/${pageId}`);
ws.onopen = () => {
handlers.onOpen?.();
};
ws.onmessage = (event) => {
try {
handlers.onMessage(JSON.parse(event.data as string) as OracleWSMessage);
@@ -196,7 +201,7 @@ export function connectPageSocket(
handlers.onClose();
if (!stopped) {
retryTimeout = setTimeout(() => {
handlers.onReconnect();
handlers.onReconnect?.();
connect();
}, 3000);
}