Distinguish between status messages and resource messages in SSE

This commit is contained in:
Eli Ribble 2026-04-28 17:06:21 +00:00
parent 38359e20e9
commit 52c41e29d8
No known key found for this signature in database
14 changed files with 106 additions and 41 deletions

View file

@ -2,7 +2,7 @@ import { defineStore } from "pinia";
import { ref } from "vue";
import { apiClient } from "@/client";
import { SSEManager, SSEMessage } from "@/SSEManager";
import { SSEManager, SSEMessageResource } from "@/SSEManager";
import { useSessionStore } from "@/store/session";
import { Communication, CommunicationDTO } from "@/type/api";
@ -13,7 +13,7 @@ export const useCommunicationStore = defineStore("communication", () => {
const error = ref(null);
// Subscription
SSEManager.subscribe((msg: SSEMessage) => {
SSEManager.subscribe((msg: SSEMessageResource) => {
if (msg.resource.startsWith("rmo:")) {
fetchAll();
}