-
Notifications
You must be signed in to change notification settings - Fork 126
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
Unhandled exception when receiving websocket error #170
Comments
This prevents unhandled exception on websocket errors. It *doesn't* propagate the error, since the subscriber is internal, and it doesn't seem to do anything with it (like notifying the client via connectionStatus). Bug: microsoft#170
#171 is a partial fix. At least it doesn't crash, but I'm not sure how to proceed from here. I need a way to notify the client. Can you suggest one? |
This prevents unhandled exception on websocket errors. It *doesn't* propagate the error, since the subscriber is internal, and it doesn't seem to do anything with it (like notifying the client via connectionStatus). Bug: microsoft#170
This prevents unhandled exception on websocket errors. It *doesn't* propagate the error, since the subscriber is internal, and it doesn't seem to do anything with it (like notifying the client via connectionStatus). Bug: microsoft#170
This prevents unhandled exception on websocket errors. It *doesn't* propagate the error, since the subscriber is internal, and it doesn't seem to do anything with it (like notifying the client via connectionStatus). Bug: #170
Here is a MWE (you need to install nock): globalThis.XMLHttpRequest = require('xhr2');
globalThis.WebSocket = require('ws');
import * as nock from 'nock';
import { DirectLine } from 'botframework-directlinejs';
const conversation = {
conversationId: '123',
token: '456',
streamUrl: 'wss://google.com/'
};
nock('https://directline.botframework.com')
.post('/v3/directline/conversations')
.reply(200, JSON.stringify(conversation));
const directLine = new DirectLine({ secret: '1234' });
directLine.activity$
.subscribe(
activity => {
if (activity.type === 'message')
console.log("received activity ", activity.text);
},
error => {
console.error(error);
}
); |
Hi. Sorry for the delay. I tested it now. It doesn't crash, but I also don't get an error event. Reproduces with the MWE I posted above. Do I need something else for capturing errors? |
@compulim ping |
You are correct. The PR #324 was a rework of your #171 without triggering the bug in RxJS and also without logging out the error in the console. Currently, DLJS was designed not to send out any events on intermittent connection errors. Looking at export enum ConnectionStatus {
Uninitialized, // the status when the DirectLine object is first created/constructed
Connecting, // currently trying to connect to the conversation
Online, // successfully connected to the conversation. Connection is healthy so far as we know.
ExpiredToken, // last operation errored out with an expired token. Possibly waiting for someone to supply a new one.
FailedToConnect, // the initial attempt to connect to the conversation failed. No recovery possible.
Ended // the bot ended the conversation
} Both
@cwhitten and @willportnoy tl;dr the customer is asking for a signal or event to indicate when reconnection took place. After some research, I think we could reuse the In W3C Server-Sent Events, they also used We could have an opt-in/out flag. I prefer an opt-out flag because this behavior is aligned with where the industry to heading towards. Any thoughts? Update: Looking at our source code today, I am a bit worried about setting a new value to |
cc @yoshigev |
It happens occasionally when the websocket connection returns 400.
Can be easily reproduced by providing a non-working domain:
Trace:
The text was updated successfully, but these errors were encountered: