fix(display): deactivate completed process before starting a new one (GM-5)#721
fix(display): deactivate completed process before starting a new one (GM-5)#721jniebuhr wants to merge 1 commit into
Conversation
…(GM-5) startProcess() assigned currentProcess without freeing an existing one. isActive() returns false once a process completes but before the next loop() tick calls deactivate(), so an activate() in that window (web/BLE on another core) overwrote and leaked the live currentProcess. Deactivate it first, preserving lastProcess bookkeeping and end events. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA guard is added to ChangesProcess lifecycle safety
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |




Summary
Controller::startProcess()assignedcurrentProcesswithout freeing an existing one.isActive()returnsfalseonce a process completes but before the nextloop()tick callsdeactivate()(which moves it intolastProcess). Anactivate()/activateGrind()in that ~100 ms window — easily hit from the AsyncTCP WebSocket handler on core 1 while completion runs on the main-loop core — overwrote and leaked the livecurrentProcess.Fix: in
startProcess(), ifcurrentProcess != nullptr, calldeactivate()first. This preserves thelastProcessauto-delay bookkeeping and fires the expectedcontroller:process:endevents, and never overwrites a live pointer.Closes GM-5.
Test plan
platformio run -e displaysucceedsplatformio run -e display-headlesssucceeds🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes