fix(question): clean up pending entry on abort (#17533)

This commit is contained in:
Kit Langton 2026-03-14 20:49:49 -04:00 committed by GitHub
parent 8f957b8f90
commit 52877d8765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -129,7 +129,12 @@ export class QuestionService extends ServiceMap.Service<QuestionService, Questio
pending.set(id, { info, deferred })
Bus.publish(Event.Asked, info)
return yield* Deferred.await(deferred)
return yield* Effect.ensuring(
Deferred.await(deferred),
Effect.sync(() => {
pending.delete(id)
}),
)
})
const reply = Effect.fn("QuestionService.reply")(function* (input: { requestID: QuestionID; answers: Answer[] }) {