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: stop timer method is called unnecessarily #1291

Merged
merged 7 commits into from
Mar 23, 2023

Conversation

geomarb
Copy link
Contributor

@geomarb geomarb commented Mar 22, 2023

Relates to:

Fixes:

Proposed Changes

  • In the useTimer (frontend) the isActiveTimer was not checking correctly the function isTimerPause it was missing the parenthesis then it was always returning true causing the execution of timerStop() function. This was the main fix in this PR.
  • In the backend when stopping the timer it was not checking if the timer was found (if it exists) and if it was already stopped, now it is checking, and logging it as a warn when the timer was not found or was found and was already stopped, it won't throw an error, it will just log it as a warn.

Other changes:

  • The default was removed from some types, interfaces and enum
  • The constants and helper functions were moved out from useTimer
  • It is now treating when a user is trying to change the status of the timer for the status it already was in those cases it will log a warn (it won't throw an error or log as error since it shouldn't break the API)

This pull request closes #1262

@geomarb geomarb self-assigned this Mar 22, 2023
@geomarb geomarb linked an issue Mar 22, 2023 that may be closed by this pull request
@geomarb geomarb added bug Something isn't working frontend backend labels Mar 22, 2023
@geomarb geomarb changed the title fix: 1262 bug stop timer method is called unnecessarily fix: stop timer method is called unnecessarily Mar 23, 2023
Copy link
Contributor

@nunocaseiro nunocaseiro left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@geomarb geomarb merged commit 3ff5f74 into main Mar 23, 2023
@geomarb geomarb deleted the fix/1262-bug-stop-timer-method-is-called-unnecessarily branch March 23, 2023 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working frontend
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG]: Stop timer method is called unnecessarily
2 participants