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

port: [#4452][#4456][#4460][botframework-streaming] Should reject pending requests on disconnection #6624

Closed
ceciliaavila opened this issue Apr 27, 2023 · 0 comments · Fixed by #6627
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. parity The issue describes a gap in parity between two or more platforms.

Comments

@ceciliaavila
Copy link
Collaborator

The changes in fix: [#4452][#4456][#4460][botframework-streaming] Should reject pending requests on disconnection may need to be ported to maintain parity with microsoft/botbuilder-dotnet.

Fixes #4452. Fixes #4456. Fixes #4460.

APPROVERS: This fix may need to port to C#. Please check C# source code and port accordingly.

Description

When Web Socket disconnected, all pending requests should be rejected.

Specific Changes

  • Added RequestManager.rejectAllResponses() to reject all pending responses
  • Updated browserWebSocketClient and nodeWebSocketClient to call RequestManager.rejectAllResponses() on disconnection
  • Fixed inconclusive tests related to .to.throw
  • Fixed a racing condition in ProtocolAdapter
    • If server respond quickly, some responses may be dropped
    • This is because their respective requests are registered in RequestManager only after the request is send, the response may already get through

Testing

Added tests to make sure NodeWebSocketClient and WebSocketServer can communicate with each other by using real Web Socket. This should make our test more stable.

Note: because there is no infrastructure for testing BrowserWebSocketClient, there are no tests added for it.

Additional context

This fix is related to an issue in botframework-directlinejs. When postActivity() is called after disconnection, it is not failing.

botframework-directlinejs did not fail the call because botframework-streaming does not reject any pending requests.

@ceciliaavila ceciliaavila added bug Indicates an unexpected problem or an unintended behavior. parity The issue describes a gap in parity between two or more platforms. labels Apr 27, 2023
@ceciliaavila ceciliaavila self-assigned this Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. parity The issue describes a gap in parity between two or more platforms.
Projects
None yet
1 participant