Add overload to deserialize GetBulkStateAsync item values#1173
Merged
Conversation
…ased deserialization of returned values instead of strictly returning serialized strings. Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
philliphoff
reviewed
Oct 23, 2023
philliphoff
reviewed
Oct 23, 2023
philliphoff
reviewed
Oct 23, 2023
…e other (typed or not) Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…ialized nature of the value. Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
…h the non-generic and generic public methods can deserialize the data once as necessary. Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
7 tasks
philliphoff
previously approved these changes
Dec 5, 2023
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1173 +/- ##
==========================================
+ Coverage 67.28% 67.36% +0.08%
==========================================
Files 174 174
Lines 6006 6028 +22
Branches 670 672 +2
==========================================
+ Hits 4041 4061 +20
- Misses 1798 1800 +2
Partials 167 167
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
halspang
requested changes
Jan 10, 2024
Contributor
halspang
left a comment
There was a problem hiding this comment.
Looks good overall, just some formatting nitpicks.
…ion requires each have their own line. Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Contributor
|
@halspang @philliphoff is this ready for merge? just checking since there's a corresponding docs PR waiting in the wings for this :) |
Collaborator
|
@hhunter-ms @halspang If Hal is ok with the last set to changes he requested (and the required merge is clean), I say merge it. |
halspang
approved these changes
Feb 16, 2024
divzi-p
pushed a commit
to divzi-p/dotnet-sdk
that referenced
this pull request
Dec 10, 2024
* Adds overload to BulkStateItem and GetBulkStateAsync to perform SDK-based deserialization of returned values instead of strictly returning serialized strings. Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Updated method summary to better direct user towards one method or the other (typed or not) Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Added comments to the typed BulkStateItem to better reflect the deserialized nature of the value. Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Refactored GetBulkStateAsync method to a shared private method so both the non-generic and generic public methods can deserialize the data once as necessary. Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Removed excessive space in comment. Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Formatting: If we're separating parameters to separate lines, convention requires each have their own line. Signed-off-by: Whit Waldo <whit.waldo@innovian.net> --------- Signed-off-by: Whit Waldo <whit.waldo@innovian.net> Co-authored-by: halspang <70976921+halspang@users.noreply.github.com> Co-authored-by: Phillip Hoff <phillip@orst.edu> Signed-off-by: Divya Perumal <diperuma@microsoft.com>
This was referenced Mar 19, 2026
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.
Adds overload to BulkStateItem and GetBulkStateAsync to perform SDK-based deserialization of returned values instead of strictly returning serialized strings.
Signed-off-by: Whit Waldo whit.waldo@innovian.net
Description
Explained in more detail at #1172 , but
GetBulkItemAsyncreturns aBulkStateItemwith a Key, ETag and Value wherein each is typed as a string and the user is expected to deserialize the Value. Because the state might have been originally added one by one, relying on Dapr and its serialization options to serialize everything, this can cause downstream issues deserializing values not originally serialized by the developer.As such, just as
GetStateAsyncallows a type parameter to deserialize each returned value, I've added the same overload toGetBulkItemAsyncto deserialize using the same mechanism asGetStateAsyncto deserialize each of the returned items as part of an overloaded and generically-typedBulkItemState.Issue reference
As it's a simple addition, I didn't think it really merited a lot of discussion as the functionality is already available for single items (and this just adds the same for multiple items).
Please reference the issue this PR will close: #1172
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:
I'll work on finding relevant documentation and updating that right now.