fix: serialize character before storing on player meta - #1
Open
gregogun wants to merge 1 commit into
Open
Conversation
Characters.select() stored the raw Character instance on player meta. In RESOURCE mode, Player.setMeta proxies through a cross-resource export call that msgpack-serializes arguments, stripping the getter-backed fields (appearanceId, name, metadata) since they live on the prototype, not as own properties. getActive() then rehydrated a plain object missing those fields. Storing character.serialize() keeps only own properties, which round-trip correctly through Character.from(). Also points the @open-core/framework devDependency at the latest published version instead of a local file: link. Co-Authored-By: Claude Sonnet 5 <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
Characters.select()stored the rawCharacterclass instance on player meta. In RESOURCE mode,Player.setMetaproxies through a cross-resource export call which msgpack-serializes its arguments, stripping getter-backed fields (appearanceId,name,metadata) since they live on the prototype rather than as own properties.getActive()then rehydrated a plain object missing those fields, silently producing characters withappearanceId: undefined(and other fields) for any consumer usingCharacters.getActive()in a RESOURCE-mode satellite.select()now storescharacter.serialize()(own-properties only), which round-trips correctly throughCharacter.from(). SimplifiedgetActive()'s fallback branch accordingly.@open-core/frameworkdevDependency from a localfile:../opencore-frameworklink to the latest published version (^1.1.0).Test plan
pnpm run typecheckpnpm run test(8/8 passing)