-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Wrap JSONRPC messages with SessionMessage for metadata support #590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG - would it be worth adding any tests that exercise the new fields that might appear in SessionMessage
? Could be that comes up in later PRs but just flagging [edit: ha nvm looking at 591 now]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as far as I can tell. note that eventually we also want at that high level wrapper around JSONMessage some form of original request so that servers can introspect for example HTTP header. I had an early PR for this and merged it but it got reverted. Just something to think about as we starting to introduce that high level wrapper.
The base branch was changed.
This PR introduces the
SessionMessage
type to encapsulate JSONRPC messages with metadata. This change enables clean separation between protocol messages and transport concerns.Problem
Previously, memory streams propagated raw JSONRPCMessage objects, which made it difficult to pass transport-specific metadata (like resumption tokens or request correlation IDs) without violating the JSONRPC spec.
Proposed solution
Introduced a new
SessionMessage
type that wrapsJSONRPCMessage
with optional metadata:With specialized metadata types:
Changes
NOTE: stacked on top of #587