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(lib.waitFor): Improved Timeout Calculation and Error Message Formatting #518

Closed
wants to merge 2 commits into from

Conversation

Kenshiin13
Copy link
Contributor

@Kenshiin13 Kenshiin13 commented Mar 16, 2024

Description

This PR includes some minor fixess to the lib.waitFor function. The changes aim to improve accuracy in handling timeout calculations and error message formatting.

Changes Made

  • Removed the redundant if condition checking for timeout truthiness or nil value.
  • Fixed the calculation of the timeout on the client-side to ensure accurate representation in milliseconds.
  • Adjusted the error message formatting to accurately represent milliseconds.

Previous Behaviour

  • When running the lib.waitFor function with timeout value of 1000:
    • On the server, the function times out after approximately 1 second, but the error message incorrectly prints "1.0ms" instead of "1000ms".
    • On the client, the function does not only print the incorrect error message, but also won't time out until after approximately 10 seconds.

Current Behaviour (Following the fix)

  • When running the lib.waitFor function with timeout value of 1000:
    • On both the server and client, the lib.waitFor function now correctly displays the error message with the accurate timeout in milliseconds. Additionally, the function now consistently times out after the correct duration.

@thelindat thelindat closed this in 2190cd3 Mar 18, 2024
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.

1 participant