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

Fix timer slowdown on inactive tab #554

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohsin-r
Copy link
Member

@mohsin-r mohsin-r commented Feb 20, 2025

Related Item(s)

#541

Changes

  • Fixed an issue where changing to a different tab would cause the timer on the modal to be displayed incorrectly.

Notes

Testing

  1. Open the dev site.
  2. Load your favourite storyline.
  3. Make a few changes.
  4. Switch to another tab for a bit (around 1-2 minutes).
  5. Go back to your tab without allowing your mouse to enter any part of the editor itself (otherwise the timer will restart).
  6. Wait.
  7. Verify that the warning modal displays when there are 2 minutes left in the session and you get kicked out with your changes saved successfully at 0 minutes left.
  8. Feel free to try other cases. For example, you could confirm extend the session, then switch tabs again, come back and verify things are all good, and so on.

This change is Reviewable

Copy link

Your demo site is ready! 🚀 Visit it here: https://ramp4-pcar4.github.io/storylines-editor/541

@mohsin-r mohsin-r added PR: Active PRs that require a fierce eyeballin. PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review. labels Feb 20, 2025
Copy link
Member

@IshavSohal IshavSohal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @mohsin-r)

Copy link
Member

@szczz szczz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mohsin-r)


server/index.js line 601 at r1 (raw file):

    const payload = JSON.stringify(message);
    clients.forEach((client) => {
        if (client.readyState === 1) {

Lets use process.env.SERVER_CURR_ENV !== '#{CURR_ENV}#' ? WebSocket.OPEN : 1 here. I know these evaluate the same but we've tested the socket server with the former so I'd rather leave this as is.

Copy link
Member Author

@mohsin-r mohsin-r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 7 of 8 files reviewed, 1 unresolved discussion (waiting on @IshavSohal and @szczz)


server/index.js line 601 at r1 (raw file):

Previously, szczz (Matt Szczerba) wrote…

Lets use process.env.SERVER_CURR_ENV !== '#{CURR_ENV}#' ? WebSocket.OPEN : 1 here. I know these evaluate the same but we've tested the socket server with the former. so I'd rather leave this as is.

Donethanks.

Copy link
Member

@yileifeng yileifeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 7 of 8 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @szczz)

Copy link
Member

@szczz szczz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got redirected at 2 seconds left on the timer and the storyline I was using seems to be permanently locked. Which build is on dev at the moment?

Reviewed 2 of 8 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @mohsin-r)

Copy link
Member

@spencerwahl spencerwahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 7 of 8 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @mohsin-r)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Active PRs that require a fierce eyeballin. PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants