Repository navigation
Fix a handful of minor bugs with the JVM implementation. - #35
Merged
Merged
Conversation
Collaborator
|
LGTM, but Claude did raise the following potential non-blocking flags; feel free to take with a pinch of salt:
I'm fine to approve once you confirm about the above! |
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
Fixes three bugs in the JVM devtools bindings that stop a JVM Player from talking to a devtools client.
DevtoolsPlugin.registerMessengerpassed a function to JSMessengerimplementsMessageHandler((Event) -> Unit), so the runtime encoded it as a JS function rather than the messenger instance. The JS plugin then failed withTypeError: messenger.sendMessage is not a function.registerMessengernow passes the backing JS instance (messenger.node).The JS
Messengerreceived the context as an ordinalThe runtime format encodes enums by ordinal, so
Messenger.Options.contextreached JS as0instead of"player"/"devtools". Every outgoing event carried the wrongcontext, and the "ignore messages from the same context" check never matched.Optionsnow serializescontextas its serial name through a private backing property, following the same pattern assendMessageandlogger.Typed events dropped
targetEventsubclasses didn't modeltarget, so any event that went through the JVM (sendMessage,messageCallback) lost it. That broke targeted delivery, for exampleMESSENGER_EVENT_BATCHreplays to a newly connected peer. This adds an optionaltarget: String? = nulltoTransactionMetaData, all typed events andUnknownEvent.API changes
targetproperty onTransactionMetaDataand on each event class, as a new trailing constructor parameter that defaults tonull. Kotlin source callers are unaffected, but already-compiled callers of the event constructors orcopy()need a recompile.patchminormajorRelease Notes
Fixes three bugs in the JVM devtools bindings that stop a JVM Player from talking to a devtools client.