-
Notifications
You must be signed in to change notification settings - Fork 626
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: set runOnce when actual date is given to setTime #740
fix: set runOnce when actual date is given to setTime #740
Conversation
1ec00ec
to
7925e83
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @sheerlox for the fix! I tested my use case with your fork and it perfectly resolves the issue.
## [3.1.4](v3.1.3...v3.1.4) (2023-10-24) ### 🐛 Bug Fixes * run once when actual date is given to setTime ([#740](#740)) ([ee54dd5](ee54dd5)) ### ⚙️ Continuous Integrations * **action:** update actions/checkout action to v4 ([#735](#735)) ([144ba67](144ba67)) ### ♻️ Chores * **deps:** lock file maintenance ([#741](#741)) ([6d94742](6d94742)) * **deps:** update dependency [@types](https://github.com/types)/jest to v29.5.6 ([#736](#736)) ([57c0efa](57c0efa)) * **deps:** update dependency [@types](https://github.com/types)/node to v20.8.7 ([#737](#737)) ([21c4065](21c4065)) * **deps:** update dependency [@typescript-eslint](https://github.com/typescript-eslint)/eslint-plugin to v6.8.0 ([#734](#734)) ([12e7487](12e7487)) * **deps:** update tests ([#738](#738)) ([3815e2a](3815e2a))
🎉 This PR is included in version 3.1.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hello. Using Cron together with with @nestjs/schedule and now my application won't build. Removal of property in PATCH release will ruin typechecks and builds for many people. It's definitely breaking change even if you didn't mention it in the docs as it was part of the type definitions. Now Job class is not backward compatible with previous versions. 😿 |
thanks for the heads up @extrememito, and sorry about the issue we caused in your build. not releasing these kinds of changes as breaking changes was probably okay for JS, but you're right that TS types actually are documentation on their own, and we should not break any public interfaces in patch or minor releases. we'll be more cautious about this in the future. #751 is going to fix the issue once it's merged and released in as a side note, I'm curious what your setup looks like, because |
Thank you!! Sure. I'm running NX monorepo where some apps are using
|
@extrememito |
…elektiv#740)" This reverts commit ee54dd5.
…elektiv#740)" This reverts commit ee54dd5.
Description
initially, set the internal variable
runOnce
correctly when passing an actual date tosetTime
. previously this was only done in the constructor.since it is only used in one place and as to limit this kind of error, I then removed the
runOnce
property completely (we now check directly ifthis.cronTime
is a real date). we do not consider this a breaking change since it was not referenced in the API documentation).Related Issue
Fixes #739.
Motivation and Context
Fixes an issue when after creating a job with a cron expression and using
setTime
with an actual date, the job attempts to run multiple times.How Has This Been Tested?
added test case provided by #739's OP.
Screenshots (if appropriate):
Types of changes
Checklist:
!
after the type/scope in the title (see the Conventional Commits standard).