fix(session): contain checkpoint dispatch resolution

This commit is contained in:
pku-xht
2026-08-08 01:03:46 +08:00
committed by Tianyi Cui
parent fa466cf673
commit 93c9782fda
2 changed files with 36 additions and 13 deletions

View File

@@ -1071,18 +1071,22 @@ export class SessionStore extends Service {
const durable = results.some(result => result.status === 'fulfilled' && result.value === true)
if (durable) {
const flushedArgs: unknown[] = [session, throughSeq]
const observers = collectSessionCallbacks(this.ctx, [
carrier,
'session/flushed',
...flushedArgs,
])
invokeContainedSessionObservers(
this.ctx,
'session/flushed',
session.id,
flushedArgs,
observers,
)
try {
const observers = collectSessionCallbacks(this.ctx, [
carrier,
'session/flushed',
...flushedArgs,
])
invokeContainedSessionObservers(
this.ctx,
'session/flushed',
session.id,
flushedArgs,
observers,
)
} catch (error: unknown) {
this.ctx.logger.warn(`session "${session.id}": session/flushed dispatch threw: ${String(error)}`)
}
}
return durable
}