feat: decode activity SSE events and expose tracker total

This commit is contained in:
c4ch3c4d3
2026-08-14 12:53:40 -06:00
parent a03278645d
commit 4727bdcf46
4 changed files with 30 additions and 0 deletions
+6
View File
@@ -8,6 +8,12 @@ export function decodeEvent(msg: SseMessage): FeedEvent | null {
if (!outer.data) return null;
const inner = JSON.parse(outer.data) as Record<string, unknown>;
if (outer.type === "activity") {
const id = typeof inner.id === "number" ? inner.id : Number.NaN;
if (Number.isFinite(id)) return { type: "activity", id };
return null;
}
if (outer.type === "inflight") {
const operation = inner.operation as string;
if (operation === "remove") {