Fix session-expired event causing events to stop

If a session-expired event is hit that does not match the current
session then it should be ignored and event processing continue without
it.  This was incorrectly implemented and instead event processing
would stop when any session-expired event was hit, not just the ones
matching the current session.

Fix logic to properly ignore session-expired events when it doesn't
match the current session.
This commit is contained in:
Hornwitser 2025-09-21 22:15:11 +02:00
parent 80cec71308
commit 5d4cdb7b83

View file

@ -192,9 +192,10 @@ function sendEventToStream(stream: EventStream, event: ApiEvent) {
if (event.type === "session-expired") { if (event.type === "session-expired") {
if (stream.sessionId === event.sessionId) { if (stream.sessionId === event.sessionId) {
stream.close("session expired"); stream.close("session expired");
}
return false; return false;
} }
return true;
}
// Account events are specially handled and only sent to the user they belong to. // Account events are specially handled and only sent to the user they belong to.
if (event.type === "account-update") { if (event.type === "account-update") {