Fix/replace application issue (#692)

* fix scenario where ws replace application from gather while awaiting command and no tasks on execution stack

* lint

* remove some debug logging
This commit is contained in:
Dave Horton
2024-03-23 16:14:16 -04:00
committed by GitHub
parent 65c241bcd1
commit ec58232b61
6 changed files with 32 additions and 24 deletions

View File

@@ -1447,6 +1447,11 @@ Duration=${duration} `
this.currentTask.kill(this, KillReason.Replaced);
this.currentTask = null;
}
else if (this.wakeupResolver) {
this.logger.debug('CallSession:replaceApplication - waking up');
this.wakeupResolver({reason: 'new tasks'});
this.wakeupResolver = null;
}
}
kill(onBackgroundGatherBargein = false) {
@@ -1471,7 +1476,8 @@ Duration=${duration} `
this.logger.info('CallSession:kill - found bargein disabled in the stack, clearing to that point');
break;
}
this.tasks.shift();
const rem = this.tasks.shift();
this.logger.debug(`CallSession:kill - clearing task ${rem.summary}`);
}
}
else this.tasks = [];