You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"@context": "http://localhost:5219/$metadata#recoveryChangeObjects/$delta",
"value": [
{
"id": null,
"currentState": {
"@type": "#microsoft.graph.user",
"id": "user1",
"displayName": "William",
"emailName": null<=email should not be written; it was not set in the delta change object
},
"deltaFromCurrent": {
"@type": "#microsoft.graph.user",
"id": "user1",
"displayName": "Bill",
"emailName": null<= email should not be written; it was not set in the delta change object
}
},
{
"id": "2",
"currentState": {
"@type": "#microsoft.graph.group",
"id": "group1",
"displayName": null,
"members@delta": [ <=this should be "members", not "members@delta -- it is the full collection
{
"@type": "#microsoft.graph.user",
"id": "user7",
"displayName": null, <= displayName was not set and should not be written"emailName": null<=emailName was not set and should not be written
}
]
},
"deltaFromCurrent": {
"@type": "#microsoft.graph.group",
"id": "group1",
"displayName": null,
"members@delta": [
{
"@type": "#microsoft.graph.user",
"id": "user3",
"displayName": null, <=displayName was not set and should not be written"emailName": null<=emailName was not set and should not be written
},
{
"@removed": {
"reason": "deleted"
},
"@id": "https://graph.microsoft.com/v1.0/users/4"<= the deleted resource set other fields, like id, that should have been written
}
]
}
}
]
}
Expected behavior
Only properties of the change objects that were set should be written
Nested ODataResourceSets within the delta payload should be serialized using ODataDeltaResourceSetSerializer, not DeltaResourceSetSerializer
Properties of deleted resources should be serialized
Other annotations, etc. of deleted and changed resources should be written just as would be for a regular resource (not shown)
Additional context
Attempting to implement the third pattern revealed some issues with how we serialize a delta payload. Many of these are there due to how the code evolved; originally delta payloads were completely separate from regular payloads, and deleted resources were completely different than regular resources. However, the 4.01 JSON delta format supported in 1), and exclusively in 2) and 3) makes delta payloads and regular payloads more similar than different, and deleted resources the same as regular resources with an additional removed control information at the beginning (and the requirement to include key fields or @id).
For these reasons, we should refactor the delta serializers to be more fully functioned and to share implementation with the non-delta serializers.
The text was updated successfully, but these errors were encountered:
Assemblies affected
ASP.NET Core OData 8.x
Describe the bug
OData has traditionally supported writing delta response payloads in two scenarios:
Recently, OData added a third scenario for returning a delta payload:
Reproduce steps
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.
Download and run the DeltaFunctions Sample
Data Model
Please share your Data model, for example, your C# class.
EDM (CSDL) Model
Request/Response
GET: http://localhost:5219/recoveryPreviewJobs/1/getChanges()
Expected behavior
Additional context
Attempting to implement the third pattern revealed some issues with how we serialize a delta payload. Many of these are there due to how the code evolved; originally delta payloads were completely separate from regular payloads, and deleted resources were completely different than regular resources. However, the 4.01 JSON delta format supported in 1), and exclusively in 2) and 3) makes delta payloads and regular payloads more similar than different, and deleted resources the same as regular resources with an additional removed control information at the beginning (and the requirement to include key fields or @id).
For these reasons, we should refactor the delta serializers to be more fully functioned and to share implementation with the non-delta serializers.
The text was updated successfully, but these errors were encountered: