Repository navigation
Kotlin/.NET/Go: select snapshot state by resource URI scheme - #595
Open
Connor Peet (connor4312) wants to merge 3 commits into
Open
Connor Peet (connor4312) wants to merge 3 commits into
Connor Peet (connor4312) wants to merge 3 commits into
Conversation
Replaces key-based SnapshotState selection, which routed every valid TerminalState (it has both content and lifecycle) to SessionState and could strictly decode unrecognized extension states as known types. Uses the shared scripts/snapshot-channels.ts table that Swift and Rust use. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…connor4312/snapshot-resource-dispatch
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
Follow-up to #593, as requested in review. Stacked on #593. It needs #593's
scripts/snapshot-channels.tsand theahp-annotations:scheme. Retarget it tomainonce #593 merges.Kotlin, .NET, and Go chose a
Snapshot.statetype by looking for distinctive keys, which caused two bugs:lifecyclewas checked beforecontent, andTerminalStatehas both, so every valid terminal snapshot was decoded asSessionStateand failed.x-) channel that happened to have acontent,lifecycle, orentrieskey was decoded strictly as a known type. The wholesubscribeorreconnectcall then failed, which violates theSnapshot.statecontract.This PR makes them work like Swift and Rust in #593:
Snapshot.resource, using the shared table, and is decoded strictly. Unrecognized schemes keep their raw JSON as Unknown.SnapshotState.decode, .NETSnapshotState.FromResource, and GoSnapshotStateFromResource.Unknown.rawis now aJsonElement.x-ext:snapshot with lookalike keys that must stay Unknown.Validation (local): root
npm test,go vet/go test ./..., Kotlin./gradlew test, .NETdotnet test(702 passed), and the Rust and Swift round-trip corpora with the new fixtures all pass.