Restore early disposal state and bypass cleanup send guard in BaseRendererControl - #400
Merged
Merged
Conversation
Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix cleanup delivery in BaseRendererControl
Restore early disposal state and bypass cleanup send guard in BaseRendererControl
Sep 8, 2026
damyanpetev
marked this pull request as ready for review
September 8, 2026 16:49
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, consistent with the stated intent, and directly address cleanup delivery after disposal without altering broader queue/locking behavior.
Pull request overview
This PR adjusts BaseRendererControl disposal behavior to ensure the cleanup message is still delivered even after the normal disposed-message guards have closed standard sends, aligning disposal ordering with the intended cleanup-delivery semantics described in PR #394/#399 context.
Changes:
- Publish
disposedValue = trueearly inDisposeAsync, before reevaluating runtime validity and before awaiting cleanup. - Send the cleanup message via
SendJsonImmediate(bypassing the disposed guard inSendMessageImmediate) while still clearing the pending message queue. - Add an inline comment documenting that cleanup intentionally bypasses the normal disposed send guard.
File summaries
| File | Description |
|---|---|
| src/componentsBase/BaseRendererControl.cs | Restores early disposal state publication and routes cleanup through a dedicated send path that isn’t blocked by normal disposed-message guards. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MayaKirova
approved these changes
Sep 9, 2026
damyanpetev
removed this pull request from stack #401
September 9, 2026 13:51
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.
This follow-up keeps PR #399 focused on cleanup delivery: restore early disposal state publication and send cleanup through a dedicated path that is not blocked by normal disposed-message guards. It preserves existing cleanup delivery/idempotency tests without pulling in the queue/disposal locking work tracked separately in #394.
Disposal ordering (reverted to early publication)
DisposeAsyncnow setsdisposedValue = truebefore runtime reevaluation and before awaiting cleanup.disposedValueassignment from thefinallyblock.Cleanup send path (dedicated bypass)
TrySendCleanupAsyncstill clears_messageQueue.SendJsonImmediate(m)directly instead ofSendMessageImmediate(m), so cleanup is delivered even after normal sends are closed by disposal.Intent made explicit