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

Timer is suspended and displays the wrong time if another browser tab was opened during the quiz #8509

Closed
JaneSjs opened this issue Jul 4, 2024 · 3 comments · Fixed by #8540
Assignees
Labels
usability user issue An issue or bug reported by users
Milestone

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Jul 4, 2024

T18850 - Quiz with Timer Issue
https://surveyjs.answerdesk.io/internal/ticket/details/T18850


To reproduce the issue, run this demo. The timer is started automatically.
image

Open another browser tab and wait for 2 minutes. Return to the quiz page and notice that the time has not elapsed.
image

Instead, the timer continues with 1 minute.

image

2024-07-04_11-38-11.mp4
@JaneSjs JaneSjs added bug user issue An issue or bug reported by users labels Jul 4, 2024
@tsv2013
Copy link
Member

tsv2013 commented Jul 4, 2024

This is the shrome (probably and other browsers) designed behavior. See the https://developer.chrome.com/blog/background_tabs?hl=en#budget-based_background_timer_throttling article.

@tsv2013
Copy link
Member

tsv2013 commented Jul 4, 2024

Some workarounds are discussed on SO - https://stackoverflow.com/questions/6032429/chrome-timeouts-interval-suspended-in-background-tabs - but I boubt they're reliable enough.

@JaneSjs JaneSjs self-assigned this Jul 4, 2024
@JaneSjs JaneSjs closed this as completed Jul 4, 2024
@JaneSjs JaneSjs removed the bug label Jul 4, 2024
@JaneSjs JaneSjs assigned andrewtelnov and unassigned JaneSjs Jul 10, 2024
@JaneSjs JaneSjs reopened this Jul 10, 2024
andrewtelnov added a commit that referenced this issue Jul 10, 2024
@andrewtelnov
Copy link
Member

The feature to check how many seconds are left before the timer fires again has been added. If the timer exceeds the maxTimeToFinish for a page, the survey will navigate to another page. The suspended time will be the difference between the time spent on this page prior to reaching maxTimeToFinish.

For example, if a page has a maxTimeToFinish of 20 seconds and a user spends 5 seconds on the page before switching to another tab for a minute before returning, the survey will move to another page. The timer on the new page will restart from 0, and the survey time will increase by 15 seconds instead of the 60 seconds initially spent (20 - 5 = 15).

tsv2013 pushed a commit that referenced this issue Jul 10, 2024
@OlgaLarina OlgaLarina added this to the v1.11.7 milestone Jul 16, 2024
@RomanTsukanov RomanTsukanov changed the title The timer is suspended and displays the wrong time if another browser tab was opened during the quiz Timer is suspended and displays the wrong time if another browser tab was opened during the quiz Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability user issue An issue or bug reported by users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants