Skip to content

Fix timer remaining-time panic and completion-count overflow - #25995

Merged
alice-i-cecile merged 2 commits into
bevyengine:mainfrom
calinrus-dev:codex/timer-edge-cases
Oct 6, 2026
Merged

alice-i-cecile merged 2 commits into
bevyengine:mainfrom
calinrus-dev:codex/timer-edge-cases

Conversation

@calinrus-dev

Copy link
Copy Markdown
Contributor

Two timer edge cases:

  • remaining(): return zero instead of panicking when elapsed exceeds duration.
  • tick(): saturate the completion count instead of wrapping, preserving just_finished().

Regression tests included. 87 tests/doc-tests passed; Clippy, formatting and the no_std check passed.

AI disclosure: Codex assisted with analysis, code, tests and PR wording. I reviewed the changes and ran the tests.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@mnmaita mnmaita added I-Crash A sudden unexpected crash A-Time Involves time keeping and reporting labels Oct 1, 2026

@alice-i-cecile alice-i-cecile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep, trivially correct. Annoying. We should consider enabling stricter lints for this stuff, at least locally within this crate.

@alice-i-cecile alice-i-cecile added X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 4, 2026
@alice-i-cecile
alice-i-cecile requested a review from kfc35 October 4, 2026 21:11
@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 5, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Oct 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 5, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Oct 6, 2026
Merged via the queue into bevyengine:main with commit a55191f Oct 6, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Time Involves time keeping and reporting D-Straightforward Simple bug fixes and API improvements, docs, test and examples I-Crash A sudden unexpected crash S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants