Skip to content

Avoid retaining retired plugins through reload callbacks - #6861

Merged
ymichael merged 1 commit into
mainfrom
slopcop/issue-6858
Nov 2, 2026
Merged

ymichael merged 1 commit into
mainfrom
slopcop/issue-6858

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · new-issue-autopilot

Human comments

What was wrong

The plugin reload failure helper captured the previous loaded instance in a context retained by the replacement plugin's API callbacks. Disposing the previous instance did not release its route-owned state: after three reloads, four payloads remained reachable instead of one.

Report: https://get-bb.github.io/reports/issues/6858.html

What changed

Capture only a boolean indicating a reload in the failure helper, leaving the previous instance local for disposal and rollback. Add an owner-boundary regression using a real plugin, weak references, and inspector-triggered garbage collection; also check that the current HTTP route still works.

Two files, 78 additions and 1 deletion: 79 changed text lines. No dependencies, generated files, storage changes, or public protocol/API changes.

How you verified

  • The regression fails on trusted main at d448d87: expected [false, false, false, true], received [true, true, true, true].
  • Repeated that failure in a second clean checkout at the same commit, with only the authored test added.
  • The focused regression passes after the fix.
  • pnpm exec turbo run test --filter=@bb/server -- test/services/plugins: 59 files, 588 tests passed.
  • pnpm exec turbo run lint typecheck build --filter=@bb/server: succeeded; this package has no separate lint script.
  • Formatting and git diff --check pass. Verified on Linux with Node 22.19.0; macOS and other reload entry points were not separately measured.

Fixes #6858

AGENT GENERATED

@ymichael
ymichael merged commit 49ed254 into main Nov 2, 2026
30 checks passed
@ymichael
ymichael deleted the slopcop/issue-6858 branch November 2, 2026 22:00
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.

Reloading a plugin in place keeps every replaced instance alive through loadOne's previous

2 participants