Skip to content

Remove this._destroyed lifecycle guard flag - #5

Merged
urhend merged 1 commit into
mainfrom
production
Aug 1, 2026
Merged

urhend merged 1 commit into
mainfrom
production

Conversation

@urhend

@urhend urhend commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove the _destroyed boolean flag added in a prior teardown-hardening pass — EGO reviewer correctly identified this as the exact "Bad Practice" example the Extension Best Practices Guidelines calls out under Lifecycle and Destruction State
  • destroy() already follows the guide's correct order (sources → signals → cancel → super.destroy() last), no flag needed
  • Kept the unrelated runCommand() fix that rethrows CANCELLED from proc.init()

Test plan

  • node --check extension.js
  • CI

EGO reviewer feedback: this is the exact "Bad Practice" pattern the
Extension Best Practices Guidelines calls out under Lifecycle and
Destruction State — boolean flags like this._destroyed guarding
against late-resolving callbacks aren't the correct fix. destroy()
already does the right things in the right order (remove sources,
disconnect signals, cancel, then super.destroy() last), which is what
the guide asks for instead.

runCommand()'s CANCELLED passthrough from proc.init() stays — that's
unrelated, not a lifecycle flag, and makes cancellation actually
propagate instead of being reported as a normal failure.
@urhend
urhend merged commit c51a0ff into main Aug 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant