Giter Club home page Giter Club logo

Comments (3)

nataliecarey avatar nataliecarey commented on July 29, 2024

Hi @nubz, one of the changes in the new implementation of the timeout dialog was to remove the expectation that setInterval will be called exactly once every 1000 milliseconds. There's a test for it here https://github.com/hmrc/assets-frontend/blob/master/assets/patterns/help-users-when-we-time-them-out-of-a-service/timeout-dialog.test.js#L525 and the implementation is here https://github.com/hmrc/assets-frontend/blob/master/assets/patterns/help-users-when-we-time-them-out-of-a-service/timeoutDialog.js#L101

Have you tested with the latest version of AF? I'd expect the upgrade to solve your problem, if not I'll gladly look deeper into it.

from assets-frontend.

nataliecarey avatar nataliecarey commented on July 29, 2024

In conversation with @gordonmcmullan I can see the logic of the problem. I'll take a look.

from assets-frontend.

nubz avatar nubz commented on July 29, 2024

Hi @matcarey - thanks for looking and yes when I see the tests around this all explicitly fail if a setInterval is being used... these would need quite an overhaul to implement something like this, and to be clear the problem is explicitly about relying on a forward moving timer to move forward in real time and this does not happen when the tab is not in focus. Both setTimeout and setInterval are unreliable versus real time... using setInterval at least gives us a chance to evaluate time elapsed.

from assets-frontend.

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.