• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

looplab / fsm / 33043495920
93%

Build:
DEFAULT BRANCH: main
Ran 27 Aug 2026 05:45AM UTC
Jobs 1
Files 7
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Aug 2026 05:45AM UTC coverage: 92.936% (+0.05%) from 92.889%
33043495920

push

github

maxekman
fix: clear the transition when the context is canceled

transitionFunc returns early when ctx.Err() != nil, but does not clear
f.transition on the way out — only the completed path below it does. Since
f.transition was already published before the context was ever checked, the FSM is
left in transition permanently: every later Event returns InTransitionError, Can()
returns false, and Transition() cannot help either, because it re-runs this same
closure and takes this same early return. Only constructing a new FSM recovers.

A state whose leave callback cancels is spared, because leaveStateCallbacks
returning CanceledError clears the flag. A state with no callbacks at all is not —
so whether a canceled context bricks the FSM depends on whether the state you
happen to be leaving has a callback registered.

Clears it with the same lock the completed path takes, and leaves e.Err untouched,
so Event still returns the context error to the caller as before.

Fixes #115.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

3 of 3 new or added lines in 1 file covered. (100.0%)

421 of 453 relevant lines covered (92.94%)

15.67 hits per line

Jobs
ID Job ID Ran Files Coverage
1 33043495920.1 27 Aug 2026 05:45AM UTC 7
92.94
GitHub Action Run
Source Files on build 33043495920
  • Tree
  • List 7
  • Changed 7
  • Source Changed 7
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b4560699 on github
  • Prev Build on main (#14882968042)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc