mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 14:50:00 -07:00
morse: guard in-flight status polls from overriding stop state
The previous stopPromise guard only prevented new polls from being dispatched. Polls already in-flight before stop was clicked could still return with running=true and override the stopping lifecycle, causing SSE reconnection and an apparent restart loop. Add a second guard in the .then() handler to check stopPromise/lifecycle before acting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -421,6 +421,8 @@ var MorseMode = (function () {
|
||||
.then(function (r) { return parseJsonSafe(r); })
|
||||
.then(function (data) {
|
||||
if (!data || typeof data !== 'object') return;
|
||||
// Guard against in-flight polls that were dispatched before stop
|
||||
if (state.stopPromise || state.lifecycle === 'stopping') return;
|
||||
|
||||
if (data.running) {
|
||||
if (data.state === 'starting') {
|
||||
|
||||
Reference in New Issue
Block a user