Repository navigation
fix: release dedup guards in MessageBusClient.remove_all_listeners - #394
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Checking the status... all automated tasks are done! ✅I've aggregated the results of the automated checks for this PR below. 📋 Repo HealthEvaluating the repository's overall condition. 📋 ✅ All required files present. Latest Version: ✅ 🏷️ Release PreviewI've checked the 'Performance Improvements' metrics. 📈 Current:
✅ PR title follows conventional commit format. 🚀 Release Channel Compatibility Predicted next version:
🔍 LintI've finished the heavy lifting on this check. 🏋️♂️ ❌ ruff: issues found in 105 file(s) — see job log 🔒 Security (pip-audit)Scanning for any potential SQL injection points. 💉 ✅ No known vulnerabilities found (52 packages scanned). ⚖️ License CheckScanning for any hidden proprietary blobs. 🌑 ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 📊 CoverageChecking the integrity of our test cases. 💎 ✅ 92.3% total coverage (threshold: 65.0%) Files below 80% coverage (1 file)
Full report: download the 🔨 Build TestsChecking the structural resonance of the codebase. 🔊 ✅ All versions pass
The bits and bytes are looking good today. 💾 |
remove_all_listeners() dropped the emitter listeners but left the handler registrations, the per-handler mirror guard and the intent-pair guard in memory. remove() and the once() cleanup already release them, and AsyncMessageBusClient.remove_all_listeners does the same. The sync method now forgets the dedup entry of every wrapper registered on the removed topic through _forget_dedup_entry, which also releases the pair guard when its last registration goes. Before the fix the three new tests fail on the non-empty _dedup_registrations map; after it they pass (full suite 1266 passed). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
b873fa4 to
466b64f
Compare
Governing clause (OVOS PIPELINE-1 appendix/divergences.md:238): "A transitional deployment MAY subscribe to both names during migration."
MessageBusClient.remove_all_listeners(event_name)removed the emitter listeners but left_dedup_registrations, the per-handler mirror guard and the intent-pair guard in memory. A live probe left one of each after the call.AsyncMessageBusClient.remove_all_listenersalready releases them.The sync method now forgets the dedup entry of each wrapper registered on the removed topic, with the existing
_forget_dedup_entryhelper. That helper also releases the pair guard with its last registration. No wire change. The asyncremove_all_listeners(None)behaviour is not touched.The new test file uses a real ovos-messagebus. It registers a handler on both spellings of a migrated topic and on an intent pair, removes all listeners on each, and asserts that the maps are empty. It then registers fresh handlers and asserts one call per emit. Further tests check that removing one spelling keeps the other registered, that a bound method of a removed handler's owner is garbage collected, and that 50 on and remove cycles on an intent topic leave no pair guard. All five fail on dev and pass with the fix. Full suite: 1268 passed.
The change adds an entry to
docs/prerelease-quirks.md.🤖 Generated with Claude Code