diff --git a/src/durable/notifications-hub.ts b/src/durable/notifications-hub.ts index ad72f7f..0b9c132 100644 --- a/src/durable/notifications-hub.ts +++ b/src/durable/notifications-hub.ts @@ -174,7 +174,7 @@ function buildSignalRMessagePackInvocation( target: string = 'ReceiveMessage' ): Uint8Array { // SignalR MessagePack hub protocol uses an array-based invocation shape: - // [type, headers, invocationId, target, arguments] + // [type, headers, invocationId, target, arguments, streamIds] const encodedPayload = encodeMsgPack([ 1, {}, @@ -187,6 +187,7 @@ function buildSignalRMessagePackInvocation( Payload: messagePayload, }, ], + [], ]); return frameSignalRBinary(encodedPayload); } @@ -217,7 +218,9 @@ export class NotificationsHub extends DurableObject { const revisionDate = String(body?.revisionDate || '').trim() || new Date().toISOString(); const userId = String(request.headers.get('X-NodeWarden-UserId') || body?.userId || '').trim(); const contextId = String(body?.contextId || '').trim() || null; - const updateType = Number(body?.updateType || SIGNALR_UPDATE_TYPE_SYNC_VAULT) || SIGNALR_UPDATE_TYPE_SYNC_VAULT; + const rawUpdateType = body?.updateType; + const parsedUpdateType = typeof rawUpdateType === 'number' ? rawUpdateType : Number(rawUpdateType); + const updateType = Number.isFinite(parsedUpdateType) ? parsedUpdateType : SIGNALR_UPDATE_TYPE_SYNC_VAULT; const targetDeviceIdentifier = String(body?.targetDeviceIdentifier || '').trim() || null; const payload = body?.payload && typeof body.payload === 'object' ? body.payload diff --git a/webapp/src/App.tsx b/webapp/src/App.tsx index 25bb9be..f88c768 100644 --- a/webapp/src/App.tsx +++ b/webapp/src/App.tsx @@ -1626,7 +1626,7 @@ export default function App() { continue; } if (contextId && contextId === getCurrentDeviceIdentifier()) continue; - if (updateType === SIGNALR_UPDATE_TYPE_SYNC_CIPHERS) { + if (updateType === SIGNALR_UPDATE_TYPE_SYNC_CIPHERS || updateType === SIGNALR_UPDATE_TYPE_SYNC_VAULT) { if (notificationRefreshTimerRef.current !== null) { window.clearTimeout(notificationRefreshTimerRef.current); } @@ -1660,7 +1660,6 @@ export default function App() { deleteSendLocally(resourceId, revisionStamp); continue; } - if (updateType === SIGNALR_UPDATE_TYPE_SYNC_VAULT) continue; } });