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

feat: timerVariant option to choose between native and worker timers #1818

Conversation

olso-nordsec
Copy link
Contributor

Closes #1806

@robertsLando robertsLando changed the title feat: option to choose between native and worker timers feat: timerVariant options to choose between native and worker timers Mar 15, 2024
@robertsLando robertsLando changed the title feat: timerVariant options to choose between native and worker timers feat: timerVariant option to choose between native and worker timers Mar 15, 2024
Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 78.94737% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 79.27%. Comparing base (50776a7) to head (9e956aa).

❗ Current head 9e956aa differs from pull request most recent head 8116828. Consider uploading reports for the commit 8116828 to get more accurate results

Files Patch % Lines
src/lib/get-timer.ts 66.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1818      +/-   ##
==========================================
- Coverage   81.02%   79.27%   -1.76%     
==========================================
  Files          24       25       +1     
  Lines        1402     1438      +36     
  Branches      330      335       +5     
==========================================
+ Hits         1136     1140       +4     
- Misses        183      215      +32     
  Partials       83       83              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/lib/PingTimer.ts Outdated Show resolved Hide resolved
@olso-nordsec
Copy link
Contributor Author

@robertsLando what about the codecov issue, worker case wont work in node environment 🤔

do you have a suggestion how to test it? or just dummy test case

@robertsLando
Copy link
Member

@olso-nordsec unfortunately codecov doesn't consider the coverage of tests running on browser (with wrt, check test:browser script ), ignore that no worries. I think there is also a way to tell codecov to ignore some lines from coverage but I never digged into that

@robertsLando
Copy link
Member

@olso-nordsec FYI: #1819

Copy link
Member

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

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

Tests are failing now, fix them (I think last change did something wrong)

In order to only trigger pingtimer tests you can use node -r esbuild-register --test test/pingTimer.ts

@robertsLando
Copy link
Member

@olso-nordsec The problem is that test rely on timer private var that now is named timerId so you should replace pingTimer['timer'] with pingTimer['timerId'] in test/pingTimer.ts

@robertsLando
Copy link
Member

@olso-nordsec news here?

@olso-nordsec
Copy link
Contributor Author

@robertsLando it was weekend, will look at it today 🙏

@robertsLando
Copy link
Member

@olso-nordsec Yeah no worries, thanks 🙏🏼

Copy link
Member

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

@robertsLando robertsLando merged commit 547519d into mqttjs:main Mar 18, 2024
4 checks passed
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.

[feat]: Add option to choose between worker-timers and native timers
2 participants