fix: set runOnce when actual date is given to setTime#740
fix: set runOnce when actual date is given to setTime#740sheerlox merged 4 commits intokelektiv:mainfrom
Conversation
1ec00ec to
7925e83
Compare
## [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
runOncecorrectly 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
runOnceproperty completely (we now check directly ifthis.cronTimeis 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
setTimewith 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).