fix: Fix BatchItem deserialization for non-string primitive values#367
fix: Fix BatchItem deserialization for non-string primitive values#367jvaesteves wants to merge 1 commit into
Conversation
|
We independently root-caused this exact bug in production today and can confirm both the diagnosis and the fix. Impact in our case: we run a data-security pipeline that fetches SharePoint driveItems via Reproduced on v1.2.1 through v1.4.1. Every numeric field in every batch response body is affected; strings and objects survive, which makes this easy to miss — our recorded test fixtures happened to contain no numeric assertions, so it shipped silently. One note: the same pattern affects the value-type node case two lines below ( Would be great to get this merged — happy to provide the full repro program if useful. |
Overview
At this moment, when making any BatchRequests, the any primitive value in the results that are not strings are not being properly deserialized. That is because the case grouping was not done properly, and it skips all possible returns inside the switch block, falling into the
return nil, nilloc. This simple change fixes this by properly collapsing these options into a single case, separate by commas.Testing
client.Drives().ByDriveId(driveID).Items().ByDriveItemId(fileID)in a single batchnilYou can use the following snippet to replicate this test. If everything goes as expected, it should not panic at all