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 bug with redundant play/pause events and with displaying current mod #157

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

AlecM33
Copy link
Owner

@AlecM33 AlecM33 commented Apr 8, 2023

Resuming the timer failed to check if the ticking variable was a non-null reference before re-assigning. I believe this was leading to weird behavior where the user could fire off play/pause events with a certain timing that would eventually fail to stop an instance of ticking (because there are multiple in memory) and cause the "end timer" event to be fired, even though it appears to be paused. We can see that below - the timer is displayed as paused at 17.3 seconds. The last message we received from the server was a pause timer event. Yet then we receive the end timer event and are prompted with such.

Stopping the timer now nulls ticking and resuming the timer will check if ticking is null before restoring a reference.

image

We also fixed a bug where we were looking to display the current moderator when no such element existed in the DOM to populate with the data. This occurred right after a temp mod's powers were transferred away. Now we check if the client is a temp mod when processing the "kill player" event and, if so, do not attempt to update the content of that element (it will get updated when the client's view is synced as a part of the mod transfer event).

@AlecM33 AlecM33 changed the title fix bug with redundant play/pause events, fix spec, tweak current mod… fix bug with redundant play/pause events, fix spec, tweak css Apr 8, 2023
@AlecM33 AlecM33 changed the title fix bug with redundant play/pause events, fix spec, tweak css fix bug with redundant play/pause events and with displaying current mod Apr 8, 2023
@AlecM33 AlecM33 merged commit 25c68a9 into master Apr 8, 2023
@AlecM33 AlecM33 deleted the timer-bugfix branch April 8, 2023 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant