-
Notifications
You must be signed in to change notification settings - Fork 49
Add new transport based on MessagePack #591
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
Merged
Merged
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
51cb8ab
messagepack format "POC"
Daniel-Svensson 5547219
Add Filtered Type Shape provider for choosing which properties to ser…
Daniel-Svensson 544901c
Initial plan
Copilot b367f17
Add initial MessagePack wire-format support
Copilot 40186f1
Setup tests to use messagepack for .net 10
Daniel-Svensson a47493b
Merge branch 'msgpack' into copilot/msgpack
Daniel-Svensson c87adeb
Address MessagePack review feedback
Copilot ab7ce22
Add async MessagePack method parameter converter
Copilot 278e896
Use filtered provider for MessagePack parameter converters
Copilot 993c1d7
remove comment
Daniel-Svensson fd65f82
som minor restructuring
Daniel-Svensson caf5599
Som updates to filtered type shape
Daniel-Svensson a743b68
envelope changes
Daniel-Svensson 440ce2c
add code for manual envelope handling
Daniel-Svensson 9c3f5ae
various fixes and refactoring
Daniel-Svensson 1492584
Fix invoke parameters
Daniel-Svensson 68ddc4c
wip
Daniel-Svensson acf5675
workaround for KnownType not beeing honored
Daniel-Svensson c7712be
Add hack to get Nerdbank.MessagePack.IMessagePackSerializationCallbac…
Daniel-Svensson 28794ff
add object derived type mapping for changeset (on server)
Daniel-Svensson 8e810f9
WIP, add ai generated converter for changesetentry on server
Daniel-Svensson c80da55
Fix invoke returning void
Daniel-Svensson 8ee0eec
only test invoke
Daniel-Svensson 6b878b8
Add IMessagePackSerializationCallbacks to complex object
Daniel-Svensson eb380d6
Fix all but 1 invoke tests
Daniel-Svensson 11f58e7
Use surrogate types for serialization of entitites
Daniel-Svensson b686dc3
Fix query return inheritance with surrogate types
Daniel-Svensson 238f10d
Only emit type info if there are derived types (Invoke+Query works)
Daniel-Svensson 73305f2
Fix included entities on client
Daniel-Svensson cdd53c8
fix problem with unions
Daniel-Svensson 3bbfad0
use null for base type
Daniel-Svensson fb6a84d
Fix deserialization of class hierarhies for Included entities
Daniel-Svensson c416e23
queries is working
Daniel-Svensson bbcd250
Initial changeset working
Daniel-Svensson c67d210
FIx most of submit test failures with a working ObjectConverter on cl…
Daniel-Svensson e67281d
Better client error for invalid entity actions
Daniel-Svensson ca8a4d7
Update serialization provider abstraction
Daniel-Svensson d526d08
Add fallback for when TryReadStringSpan fails
Daniel-Svensson 8abd907
Fix MetaMember lookup in filtered typeshape provider
Daniel-Svensson 30f8987
Improve discriminator logic
Daniel-Svensson b456da2
fix void result again
Daniel-Svensson 204f444
fix ArgumentException Throw helper usage
Daniel-Svensson b4105a7
serialize queryResults as base type
Daniel-Svensson c9c0741
Cleanup and optimize SurrogateFactory somewhat
Daniel-Svensson 6bad68a
Update codegen to emit deserialization constructor
Daniel-Svensson ce8331e
update generated code for T4 templates
Daniel-Svensson 5782ea4
fix parameter name
Daniel-Svensson ffc399b
update nuspec with dependencies
Daniel-Svensson 3879fcf
remove BinaryConverter
Daniel-Svensson a600a93
remove extra objectconverter on client
Daniel-Svensson eb5ba8f
Fixa aspnetcore tests
Daniel-Svensson 032c15c
Revert "remove BinaryConverter"
Daniel-Svensson db9a6c6
Fix coderabbiy comments
Daniel-Svensson 03ade9f
fix a number of coderabbit review comments
Daniel-Svensson 758ccc1
Merge branch 'main' of https://github.com/OpenRIAServices/OpenRiaServ…
Daniel-Svensson 47e978f
run webserver using net10 on local development
Daniel-Svensson cdafedf
fix exception test case
Daniel-Svensson 03ef477
Apply suggestions from code review
Daniel-Svensson 9de3d9f
remove type shape provider for now
Daniel-Svensson cd47f76
sync version of System.IO.Hashing
Daniel-Svensson ec041d9
Fix some comments, including fixing discriminator for DervicedTypeShape
Daniel-Svensson 1c2fd79
update error handling for T4 templates
Daniel-Svensson df6c5e5
Fix last coderabbit comments
Daniel-Svensson 2e4706a
fix review comments
Daniel-Svensson 9698dbf
update aspnetcore nuget version
Daniel-Svensson 9499e5b
FIx handling of inheritance for entities
Daniel-Svensson 4b1746a
Apply suggestions from code review
Daniel-Svensson f123b70
Apply suggestions from code review
Daniel-Svensson ac3a7f8
Fix sonarcloud warnings
Daniel-Svensson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # MessagePack serialization wire schema (draft) | ||
|
|
||
| OpenRiaServices supports MessagePack with MIME type `application/vnd.msgpack`. | ||
|
|
||
| ## Request envelope (POST/QUERY/Submit) | ||
|
|
||
| Top-level object map: | ||
|
|
||
| - `Parameters`: map<string, value?> | ||
| Parameter name to a MessagePack value serialized with the declared parameter type converter. `nil` means `null`. | ||
| - `QueryOptions`: array of `ServiceQueryPart` (optional) | ||
| - `IncludeTotalCount`: bool (optional) | ||
|
|
||
| ## Success response envelope | ||
|
|
||
| Top-level object map: | ||
|
|
||
| - `Result`: value? | ||
| MessagePack value for the declared operation return type. `nil` means `null` / no value. | ||
|
|
||
| ## Fault response envelope | ||
|
|
||
| Top-level object map: | ||
|
|
||
| - `Fault`: `DomainServiceFault` | ||
| ## Notes | ||
|
|
||
| - GET query behavior stays unchanged (URL-encoded query parameters). | ||
| - Envelopes are map-based for schema/version tolerance. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Serialization Of Class hierarchies does not work | ||
|
|
||
| Consider the following class hierarchy. | ||
| Where A is annotated with `KnownTypeAttribute` for `B` and `C`. | ||
| ``` | ||
| A -> B -> C | ||
| ``` | ||
|
|
||
| A serializer for A can properly serialize and deserialize all 3 classes. | ||
| A serializer for B does not work for objects of type `C`. | ||
|
|
||
| Desired behaviour: | ||
| * Serializer for `A` can serialize/deserialize all 3 types (with a single discriminator) | ||
| * Serializer for `B` can serialize/deserialize B and C | ||
| * Can serialize/deserialize objects of known type based on "object" serializer | ||
| * Should work with existing code gen (basetype has all "known type" attribytes) | ||
| * No usage of surrogates/marshalling types | ||
|
|
||
| Problems: | ||
| * Using DerivedShapeMapping have the following issues | ||
| * Serialization of B using shape A suddenly use 2 discriminators `["B", ["B", ...] ]` | ||
| * Serialization of B`s derived classses does not pick the most specific instance , a bug?? | ||
| * There is some sorting of DerivedShapeMapping based on inheritance, | ||
| but it can still pick the base instance instead of the actual type. | ||
| This is especially bad when B is abstract. | ||
| See `AI_Detail` class where derived types were serialized as `AI_Detail` insted of actual type. | ||
| * Cannot add custom converter for types using built in | ||
|
|
||
| Workarounds: | ||
| * Added a `ObjectConverter` class on client | ||
| * The `ObjectConverter` class has a custom "ReflectionTypeShapeProvider" with special assemblies specified | ||
| Also "unwrapping" of `IUnionTypeShape<T>` is needed to get the underlying "object serializer" | ||
| * This allows caching of the "ObjectSerializers" | ||
| * Added `SurrogateConverter` class on server | ||
| * Create dynamic classes/instances with same name and properties (without KnownTypeAttributes) | ||
| * To get Queries, Invoke and method parameters to work | ||
| * See test : Inherit_Run_CUD_Delete_Derived which failes since abstract class cannot be deserialized | ||
| * Maybe always serialize/deserialize using "base type" serializer ?? | ||
| * MethodParametersConverter (Client) | ||
| * ChangeSetEntryConverter (Client) (entity actions) | ||
| * MessagePackHttpDomainClient.GetResponseEnvelopeType* (client) | ||
| * MethodParametersConverter (server) | ||
| * MessagePackRequestSerializer.WriteQueryResponseAsync (server) | ||
| * MessagePackRequestSerializer.CreateInvokeResponseEnvelope (server) | ||
|
|
||
|
|
||
| # Serializing using | ||
|
|
||
| # Object and Union converter for same type cannot coexist | ||
|
|
||
| Problems | ||
| * Cannot get "object" converter for a specific Type, the converter is "always" UnionTypeShape | ||
| * Converter Cache does dot distinguish betweeen `IUniontTypeShape<T>` and `IObjectTypeShape<T>` | ||
|
|
||
| # Other bugs | ||
|
|
||
| PolyType does not handle TestDomainServices.MockReport correctly, it generate a constructor takeing 6 arguments meaning | ||
| serialization callbacks will note be executed. | ||
|
|
||
| Resulting in failed test | ||
|
|
||
| * Addin a ctor with required parameters still does not resolve the issue. | ||
| * adding required parameters to ctor leads to duplicate parameters | ||
|
|
||
| # Other todos etc | ||
|
|
||
| * Creata a server side test corresponding to DomainClient_SubmitWithNonexistentDomainMethod | ||
| * Validate behaviour when client send entityAction that does not exist | ||
| * Update generated code to handle TestDomainServices.MockReport issue with required members | ||
| * Ensure whole class hierarchies are properly serialized/deserialized when using "object" serializer | ||
| * See " Maybe always serialize/deserialize using "base type" serializer ??" above | ||
| * PARTIALLY IMPLEMENTED (Queries only) | ||
| * `MessagePackHttpDomainClient.GetResponseEnvelopeType` + `MessagePackRequestSerializer.WriteQueryResponseAsync` |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.