Conversation
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.
Addresses review finding R39.
Renaming a collection in a version upgrade currently fails because typed
Get<NetworkList<T>>/Get<NetworkDictionary<TKey, TValue>>andWritedo not support collections.CopyExceptcan retain the original name, but cannot express the rename. This fixes R39 by addingNetworkObjectUpgradeWriter.Copy(sourceName, destinationName), which appends an existing source field's encoded value under a new name without decoding it. For example, a generated version-oneValues = [3, 5]payload now migrates to version-twoItems = [3, 5]through the public upgrade API.Both names are validated and the source reader and field must exist. Source lookup uses the same ordinal, case-sensitive, last-duplicate-wins behavior as
Get<T>. Copies use the existing raw writer, including its completion and 65,535-field guards. Copying appends a field; it does not remove source fields or replace previous output fields, so rename migrations exclude old names and any destination fields being replaced fromCopyExcept. No public arbitrary raw-buffer writer is introduced.Validation
Copywas absent. The original runtime audit also reproduced the typed collection rename/write failures and passing unchanged-copy control.CopyExceptalso preserves the entire upgrade payload byte-for-byte.Writebehavior, opaque empty fields, writer completion, and the existing field-count limit. Typed list/dictionary reads and writes remain explicitly tested as unsupported.MemoryRelayTransport.cs:21remains; no dependency, SDK, language, or CI settings changed.Compatibility and integration
The API is additive and changes no wire encoding. Existing
Get,TryGet,Write, andCopyExceptbehavior is preserved.Copyonly operates on a present source field and preserves its bytes; it does not decode or transform collection contents, convert element types, or upgrade legacy encodings. Typed collection transformations remain unsupported, and the destination must accept the existing value encoding.R10, R11, and R38 independently change value encodings. Raw copying cannot convert data written with their earlier encodings into a corrected encoding; any such stored-data conversion needs a separate compatible migration. This branch was tested independently, not as a combined integration of those fixes.
The README documents the copy API and remaining limits, and requires all upgrade reads/writes to finish synchronously before returning because generated deserialization then completes the writer. This section overlaps R31 (#36); when combining, retain R31's synchronous-upgrade contract and its CN0018 guidance for rejected async upgrade methods.