Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SkillDialog saving state while receiving multiple quick-succession Typing activities leads to failed storage writes #4360

Open
stevengum opened this issue Nov 11, 2022 · 1 comment
Labels
Area: Skills The issue is related to skills bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@stevengum
Copy link
Member

Versions

SDK version 4.8.x to Latest

Describe the bug

SkillDialog attempts to save conversation state when all activities are forwarded to the skill.

// Always save state before forwarding
// (the dialog stack won't get updated with the skillDialog and things won't work if you don't)
const skillInfo = this.dialogOptions.skill;
await this.dialogOptions.conversationState.saveChanges(context, true);

This means that informational but not necessarily actionable activities such as Typing activities trigger state saves.

Human Handoff scenario

Typing activities should continue to be forwarded to skill, in case the skill acts as a middleman and routes typing activities to a human agent who is speaking with the end-user.

E.g.

sequenceDiagram
    participant Customer's Web Chat
    Note right of Customer's Web Chat: Web Chat instance<br/>is configured to send Typing activities
    participant Root bot
    participant Skill bot
    participant Human agent
    Customer's Web Chat-->>Root bot: Customer says: <br/> "Escalate to agent"
    Root bot-->>Skill bot: Begin handoff
    Skill bot-->>Human agent: Customer seeking agent
    Human agent-->>Customer's Web Chat: Human agent says<br/> "Hello, how can I help you today?"
    Note right of Customer's Web Chat: Customer begins typing for 12 seconds
    Customer's Web Chat-->>Root bot: Web Chat sends<br/>a 3 second debounced Typing activities<br/>to Root bot, etc.
Loading

Which leads to four attempts by the Root bot trying to save the state while trying to send four typing activities to the Skill bot.
These typing activities should be forwarded to the human agent, but there are no meaningful state changes in either bot whilst the customer is speaking to the agent.

Additionally, by saving state whilst sending Typing activities to storage can lead to 404s and/or 412s depending on the stoage provider.

Note: Loading state is still necessary as otherwise the root bot would not be able to send the Typing activity to the skill.

Additional context

Any changes needs to be ported to the other SDK languages as well.

@stevengum stevengum added bug Indicates an unexpected problem or an unintended behavior. Area: Skills The issue is related to skills needs-triage The issue has just been created and it has not been reviewed by the team. labels Nov 11, 2022
@tracyboehrer
Copy link
Member

Both DotNet and JS force a state save. I wonder why because if no changes have been made to state, it wouldn't make sense to save in any case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Skills The issue is related to skills bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants