'Amazon Lex V2 Lambda not progressing to next slot

I have a LEX V2 bot configured, which has two slots and a confirmation slot. The two slots ask for dateFrom and dateTo. Now I have a Lambda that I use for fulfilment but also needs to fire on every single event. After the initial utterance, the Lambda takes the event.proposedNextState.dialogAction.slotToElicit and returns that inside dialogAction.slotToElicit along with dialogAction.type set to "Delegate". Now that works fine, however after providing the dateFrom value, even though the lambda responds with

{
  sessionState: { dialogAction: { type: 'Delegate', slotToElicit: 'dateTo' } }
}

the next slot is not dateTo, but rather dateFrom again. Anyone has any ideas why it might not work like that? I don't understand why it is like that, maybe I am supposed to send a different type on dialog action? Below is the full Lambda function which handles events that are of type DialogCodeHook:

const response: LexResponse = {
    sessionState: {
      dialogAction: {
        type: LexDialogActionType.Delegate,
        slotToElicit: event.proposedNextState.dialogAction.slotToElicit,
      },
    },
  };
  console.log("EVENT", event);
  console.log("RESPONSE", response);
  callback(null, response);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source