Skip to content

Fix time based conditions bug - #103

Merged
almostearthling merged 9 commits into
mainfrom
development
Jun 9, 2026
Merged

almostearthling merged 9 commits into
mainfrom
development

Conversation

@almostearthling

Copy link
Copy Markdown
Owner

This branch fixes a bug that has always been there, and that I wasn't able to discover until I started using time based conditions whose related tasks were short: the end time started being either too close to the presumed startup time, or even to happen before it: this breaks the "contract" stated in the documentation for which conditions are teested (and thus tasks are run) after a certain condition is verified.

Due to an incorrect calculation, the test was successful within the tick before the specified time instead of the one that took place after it: the calculation is now fixed.

Also, an unlikely (yet possible) chance to completely skip the verification of a time based condition, which required the machine to be very fast and the load close to zero, has been corrected.

Current setup is also less strict on crate dependencies, so that dependency updates are more likely to be accepted: this might cost something in terms of development, in order to be always compatible with all the dependencies, with the advantage of trying to mostly use the most up-to-date versions of the libraries: for instance, some of the code that involves process spawning (i.e. the one used for command based items) has been adapted to the stable version of the subprocess library, instead of requiring the deprecated one, and this led to more compact code and a slightly smaller binary.

almostearthling and others added 9 commits May 24, 2026 16:33
Minor style amendments that might even bring some (unnoticeable) performance improvement
This commit deeply refactors the command based items in order to use the stable version of the `subprocess` crate, which has changed significantly and doesn't support `Popen` objects. Also, dependency versions in Cargo.toml have been loosened, although this does not change the actual way the dependencies are chosen.
Force time based condition to be verified just AFTER the related time specification has passed and is compliant with the specified instant, instead of being successful just BEFORE
@almostearthling almostearthling self-assigned this Jun 9, 2026
@almostearthling almostearthling added bug Something isn't working update Comply with updated versions of libraries or tools labels Jun 9, 2026
@almostearthling almostearthling modified the milestone: Version 1.2 Jun 9, 2026
@almostearthling
almostearthling merged commit ddb6926 into main Jun 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working update Comply with updated versions of libraries or tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant