Repository navigation
Conversation
…Metadata in map2json map2json was using the includeMetadata parameter to decide whether to emit the @props type-hint string. This bundled @props into every toJSON(true) call, including the WebSocket ChangeEvent broadcast path where no consumer can opt in to receiving it. Fix: use the serializer-level includeTypeHints field (off by default, same as serializeResult from ArcadeData#5860) instead of the includeMetadata parameter. The @props hint is now emitted only when the caller explicitly enables it via JsonSerializer.setIncludeTypeHints(true).
…Metadata in map2json
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Member
|
Thanks for finding and fixing this, @waterWang! I've opened #5980 with the same fix plus regression test coverage for both the |
Member
|
Superseded by #5980. |
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.
Description
Follow-up to #5812 / #5860.
map2jsonwas using theincludeMetadataparameter to decide whether to emit the@propsper-column JSON type-hint string. This bundled@propsinto everytoJSON(true)call, including theWebSocketEventBus/ChangeEventbroadcast path where no consumer can opt in to receiving it.The
WebSocketEventBuscallsrecord.toJSON(true)once per change event and broadcasts the resulting JSON string to every connected subscriber. There is no per-subscriber request to key an opt-in off of, so today every subscriber gets@propson any property whose type is lossy through JSON (SHORT,FLOAT,LONG, temporals, ...) and isn't declared in the schema.Fix
Decouple
@propsemission fromincludeMetadatainmap2json, mirroring the #5860 fix forserializeResult:map2jsonnow uses the serializer-levelincludeTypeHintsfield (off by default) instead of theincludeMetadataparameter to decide whether to emit@props.includeMetadatakeeps its original meaning: "include@rid/@type/@cat/@in/@out" identity metadata only.@propshint is now emitted only when the caller explicitly enables it viaJsonSerializer.setIncludeTypeHints(true).Behavior
ChangeEvent.toJSON()(WebSocket fan-out) no longer emits@props— a WS subscriber has no way to request it.document.toJSON(true)no longer get an unexpected@propsfield mixed in.setIncludeTypeHints(true)if needed; the server ignores unknown@-prefixed fields either way.Test plan
JsonSerializerTestalready coverspropsHintOffByDefaultfrom fix(#5812): make the @props JSON type hint opt-in, off by default #5860 forserializeResult; the sameincludeTypeHintsfield now governsmap2json, so the existing fixtures hold.ChangeEventserialization no longer contains@propsby default.Closes #5863