bugfix: if waitUrl of enqueue task includes leave but caller is dequeued before leave is reached, ignore leave

This commit is contained in:
Dave Horton
2021-08-03 16:36:17 -04:00
parent 1a2aaf9845
commit df8dac367c

View File

@@ -114,6 +114,7 @@ class TaskEnqueue extends Task {
this.bridgeDetails = opts;
this.logger.info({bridgeDetails: this.bridgeDetails}, `time to dequeue from ${this.queueName}`);
if (this._playSession) {
this._leave = false;
this._playSession.kill();
this._playSession = null;
}
@@ -325,10 +326,9 @@ class TaskEnqueue extends Task {
// check for 'leave' verb and only execute tasks up till then
const tasksToRun = [];
let leave = false;
for (const o of tasks) {
if (o.name === TaskName.Leave) {
leave = true;
this._leave = true;
this.logger.info('waitHook returned a leave task');
break;
}
@@ -348,7 +348,7 @@ class TaskEnqueue extends Task {
await this._playSession.exec();
this._playSession = null;
}
if (leave) {
if (this._leave) {
this.state = QueueResults.Leave;
this.kill(cs);
}