File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -258,16 +258,7 @@ export class TriggerChatTransport<
258258 }
259259
260260 if ( ! runState . isActive ) {
261- try {
262- await this . runStore . delete ( options . chatId ) ;
263- } catch ( error ) {
264- await this . reportError ( {
265- phase : "reconnect" ,
266- chatId : runState . chatId ,
267- runId : runState . runId ,
268- error : normalizeError ( error ) ,
269- } ) ;
270- }
261+ await this . cleanupInactiveReconnectState ( runState ) ;
271262 return null ;
272263 }
273264
@@ -423,6 +414,19 @@ export class TriggerChatTransport<
423414 }
424415 }
425416
417+ private async cleanupInactiveReconnectState ( runState : TriggerChatRunState ) {
418+ try {
419+ await this . runStore . delete ( runState . chatId ) ;
420+ } catch ( error ) {
421+ await this . reportError ( {
422+ phase : "reconnect" ,
423+ chatId : runState . chatId ,
424+ runId : runState . runId ,
425+ error : normalizeError ( error ) ,
426+ } ) ;
427+ }
428+ }
429+
426430 private async reportError ( event : TriggerChatTransportError ) {
427431 if ( ! this . onError ) {
428432 return ;
You can’t perform that action at this time.
0 commit comments