Git Product home page Git Product logo

Comments (6)

hatched avatar hatched commented on June 22, 2024

This is happening because it's trying to send a login request after the websocket connection has been terminated. I'm assuming this happens after you've let it sit for a while without logging in?

I need to add the Pinger facade to keep this connection open until the user clicks to log in. Once logged in we request the model list often so we probably don't need it there, but it can't hurt to also add the Pinger to the controller once logged in.

from juju-dashboard.

clagom avatar clagom commented on June 22, 2024

This is in the small tasks epic for this iteration, does it mean you are planning to work on this for this iteration? If that's the case we need to assign also the milestone, and move the card to the current column.

from juju-dashboard.

hatched avatar hatched commented on June 22, 2024

This is actually a combination of three issues:

  1. As previously mentioned, the websocket connection to the controller will terminate after one minute of inactivity making it impossible to send the actual login message.

  2. When the connection to the controller is made it returns a url which we then make a long polling HTTPS request to. This connection will return a 'logged in' value once the user visits the supplied 'visit url'. If this url is not visited within ~50s then it will also be terminated by the remote end. While we can retry this connection when it's closed, the token will eventually expire and then even if the user clicks to log in the request will fail.

  3. Once a connection is made to the controller we need to perform some activity on it every minute or it will be closed down by Juju as inactive.

In order to robustly solve this issue we need to address all three problems:

  1. Remedied by using https://www.npmjs.com/package/reconnecting-websocket in place of the built in websocket implementation. This package implements the same w3c api so it's a drop in replacement.

  2. This will require an architecture/approach change to handling the login mechanism. We want to immediately connect to the controller on application load and attempt to log in to provide a good user experience. But upon failure we cannot simply retry forever and hope the user doesn't just walk away from their browser for days. This is also bad for power/bandwidth consumption on mobile devices. If we're unable to immediately log in using a stored macaroon we may want to disconnect from the controller and not make the polling request to the 'wait url' until the user interacts with a separate login button.

    • The redirect login flow should be available in a couple months so before investing heavily in making this login more resilient lets revisit this in a couple months to see the status on the auth updates permitting a redirect login flow.
  3. We'll use the Pinger facade to keep the connection open. This facade was explicitly designed for this issue when developing the old GUI.

from juju-dashboard.

clagom avatar clagom commented on June 22, 2024

@hatched how are we planning this? You broke this epic down in the comment, should probably be issue attached here? CC @cristinadresch

from juju-dashboard.

clagom avatar clagom commented on June 22, 2024

Is this still relevant or did we include in the Vancouver POC epic? @hatched @hatched @cristinadresch

from juju-dashboard.

hatched avatar hatched commented on June 22, 2024

The root cause of this issue still exists. This is not part of the POC.

from juju-dashboard.

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.