Skip to content

fix: prevent formatter registration after context disposal - #142

Merged
Eduardo Villalpando Mello (edvilme) merged 1 commit into
mainfrom
fix/formatter-placeholder-after-dispose
Nov 12, 2026
Merged

Eduardo Villalpando Mello (edvilme) merged 1 commit into
mainfrom
fix/formatter-placeholder-after-dispose

Conversation

@edvilme

Copy link
Copy Markdown
Contributor

Summary

Fixes #138.

  • Prevent a rejected in-flight restart from re-registering the formatter placeholder after context disposal.
  • Guard the same lifetime boundary when missing-interpreter shutdown or per-project initialization finishes after disposal.
  • Add four deferred-barrier regression tests, including preservation of fallback recovery on a live context.

Restart scheduling, shutdown waiting semantics, and normal formatter recovery are unchanged.

Validation

  • Before the fix, the reported reproduction left two provider registrations and one live provider after disposal, rather than one registration and no live providers. Two analogous disposal regressions also failed.
  • Full TypeScript suite: 156 passing on Node 24.17.0, Windows x64.
  • TypeScript build, production lint, changed-test ESLint, and git diff --check: passed; existing nonblocking lint warnings remain.
  • Independently reran all four new regression cases before committing: 4 passing on Node 26.13.0.

Guard late restart failures, missing-interpreter shutdown, and per-project initialization against restoring the formatter placeholder after disposal. Preserve fallback recovery for live contexts and cover all paths with deferred regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 85ef72cc-9e26-4bc4-b1c3-55256d9bef91

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the changes preventing formatter-placeholder restoration after disposal.

No open issues 🎉

What changed in this PR

Addresses #138 by preventing asynchronous server operations from restoring the formatter placeholder after the extension context is disposed, while preserving fallback recovery for live contexts.

Changes:

  • Add disposal guards after per-project initialization, missing-interpreter shutdown, and restart failure.
  • Add four regression tests covering disposal races and live-context fallback recovery.
  • Clarify that disposal removes the placeholder without waiting for in-flight restarts.
File Description
typescript/​tests/​activation.test.ts Add deferred-barrier tests for disposal safety and fallback recovery.
typescript/​src/​activation.ts Guard formatter registration after disposal and clarify the lifecycle contract.

Review effort: Balanced

Comment thread typescript/src/activation.ts Resolved
Comment thread typescript/src/activation.ts Resolved
@rchiodo

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR.

@edvilme Eduardo Villalpando Mello (edvilme) added the debt Code Cleanup, Refactorings and Repo health. Not feature related label Nov 12, 2026
@rchiodo

Copy link
Copy Markdown
Contributor

Reviewed commit: 611209ffddb5d263785b93c051727ee8bef84b9c

Result: 🔴 could-not-verify

Verification details

Verification: Automated verification is best effort. The PR author remains responsible for testing.

Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: Podman machine &#x27;pyrx-automation&#x27; is not running.

Test runs: none recorded.

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved via Review Center.

@rchiodo Rich Chiodo (rchiodo) added the review-auto:approved Automated review: no blocking findings (approval posted). label Nov 12, 2026
@edvilme
Eduardo Villalpando Mello (edvilme) merged commit c0f1fbe into main Nov 12, 2026
22 of 23 checks passed
@edvilme
Eduardo Villalpando Mello (edvilme) deleted the fix/formatter-placeholder-after-dispose branch November 12, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code Cleanup, Refactorings and Repo health. Not feature related review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lifecycle] Formatter placeholder can be re-registered after disposal

4 participants