test: verify multi-handler ordering with reverted ExternalActionPlugin#839
Draft
shahabdsh wants to merge 2 commits intoplayer-ui:mainfrom
Draft
Conversation
This reverts commit 9f3439a.
When multiple ExternalActionPlugin instances are registered (e.g. in a plugin architecture where a host and embedded component each register their own handler), the interaction between handlers matters. With the pre-refactor implementation (transition hook + setTimeout), if the first handler resolves synchronously, the second handler is never invoked because the player has already transitioned away from the external state. This is the correct behavior — a resolved external state should not trigger additional handler side effects. These tests document and verify this behavior. All 3 tests pass with the reverted implementation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Companion to #838. This PR reverts #832 (ExternalActionPlugin refactor) and adds the same multi-handler ordering tests to demonstrate that all 3 tests pass with the pre-refactor implementation.
What this PR contains
transitionhook +setTimeout(0)implementationWhy the tests pass here but fail on main
With the original
setTimeout(0)approach:setTimeoutcallbacksetTimeoutcallback finds the player has already moved away from the external state → second handler is never invokedWith the
afterTransitionapproach (#832):currentStateat the same moment, before either transitionsThis behavioral difference affects plugin architectures where multiple
ExternalActionPlugininstances are registered — the second handler's side effects now fire even when the first handler has already resolved the external state.Test results
🤖 Generated with Claude Code