Coder Social home page Coder Social logo

ws.onerror about botframework-directlinejs HOT 3 CLOSED

microsoft avatar microsoft commented on July 17, 2024
ws.onerror

from botframework-directlinejs.

Comments (3)

billba avatar billba commented on July 17, 2024

The internal method observableWebSocket does throw errors. activity$ calls webSocketActivity$, which catches the errors from observableWebSocket and repeatedly attempts to reconnect to the webSocket.

Basically DirectLineJS handles every error condition as well as possible, and so if activity$ throws an error it means it has tried everything repeatedly, and nothing worked.

In the case of WebChat, we have a plan to have the UX reflect this state, but that code is not in place and so we don't handle the error right now. I admit that this is not ideal, but the new code is coming soon!

from botframework-directlinejs.

vasilkrastev90 avatar vasilkrastev90 commented on July 17, 2024

Thanks for your response Bill.

I have played around with RX (https://jsfiddle.net/gk6se537/) and my understanding is that if there is some error caused by abnormal socket termination (as actually specified in code comments) then the retryWhen will cause the whole sequence to execute again. This means that a upon a successful recovery a new socket will be created. It should also seamlessly recover all messages possibly missed due to the error.

However a question that remains unanswered for me is that it seems that if the socket creation fails for some reason this error is not handled. i.e. ( https://jsfiddle.net/x2gnzv2y/ ) Am I missing something here?

from botframework-directlinejs.

billba avatar billba commented on July 17, 2024

If WebSocket fails on creation it doesn't throw an error, it just calls onClose. This was certainly surprising to me when I was testing the code!

from botframework-directlinejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.