mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
When a session is open, the web app now keeps an always-on all:true SSE connection for sidebar session-updated events while using a second session-scoped stream for message delivery. Also bump session activity on hub sendMessage so web-originated sends refresh list timestamps. Fixes tiann/hapi#693 Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
462 B
TypeScript
21 lines
462 B
TypeScript
export type AppGlobalSseSubscription = {
|
|
all: true
|
|
}
|
|
|
|
export type AppSessionSseSubscription = {
|
|
sessionId: string
|
|
}
|
|
|
|
export function getAppGlobalSseSubscription(): AppGlobalSseSubscription {
|
|
return { all: true }
|
|
}
|
|
|
|
export function getAppSessionSseSubscription(
|
|
selectedSessionId: string | null | undefined
|
|
): AppSessionSseSubscription | null {
|
|
if (!selectedSessionId) {
|
|
return null
|
|
}
|
|
return { sessionId: selectedSessionId }
|
|
}
|