fix: property access error during rundown deactivation#1762
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR refactors StudioObserver's observer callback handling and adds regression tests. Handler functions are cached before being passed to observer factories, and the PieceInstancesObserver disposer is simplified. A comprehensive test verifies that observer callbacks work correctly when invoked without ChangesObserver callback cleanup refactoring and testing
🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Actionable comments posted: 0 |
About the Contributor
This pull request is posted on behalf of the CBC.
Type of Contribution
This is a: Bug fix
Current Behavior
On rundown deactivation, Meteor server intermittently throws:
TypeError: attempted to get private field on non-instanceA hot fix was applied in #1753 to prevent Sofie from crashing, but the error remained.
Stack traces point to
meteor/server/api/deviceTriggers/StudioObserver.tsinside observer change callbacks (eg. around lines ~222 and ~231), where a class private field access occurs from a callback executed without a valid class instance context.New Behavior
Rundown deactivation no longer throws the private-field access error.
The observer callbacks no longer depend on
thisat call time; instead they use captured handler references, so even if the callback is invoked withthis === undefined, it executes safely.Testing
Manual verification:
attempted to get private field on non-instance.Affected areas
meteor/server/api/deviceTriggers/*observersTime Frame
Not urgent, but we would like to get this merged into the in-development release.
Other Information
Status