Repository navigation
Avoid retaining retired plugins through reload callbacks - #6861
Merged
Merged
Conversation
Closed
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚨 SLOP COP 🚨 ·
new-issue-autopilotHuman 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
[false, false, false, true], received[true, true, true, true].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.git diff --checkpass. Verified on Linux with Node 22.19.0; macOS and other reload entry points were not separately measured.Fixes #6858