Skip to content
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

Marked bulk state Value property as nullable #1259

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

WhitWaldo
Copy link
Contributor

Description

If a request is made for bulk state for a set of keys for which there isn't matching data, a null value is returned for that key in the result. An issue was raised that indicated that the value isn't marked as nullable, so the author was surprised to find that the value for an unregistered key returned null given that so many other packages are marked with such annotations these days.

As such, I marked the file (not the larger project) with nullable annotations and indicated that the Value property is nullable as well. This requires no changes on the Dapr sidecar itself and simply updates the C# package to reflect what's already returned so developers are up to speed on expectations.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1255

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests (not applicable)
  • Extended the documentation (not applicable)

…l value (which it will if a key doesn't have any data in the state store). Only enabled nullable annotation on this file for now.

Signed-off-by: Whit Waldo <[email protected]>
@WhitWaldo WhitWaldo requested review from a team as code owners April 3, 2024 07:31
@WhitWaldo WhitWaldo changed the title Updated property on type to reflect the fact that it can return a nul… Marked Value property as nullable Apr 3, 2024
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.28%. Comparing base (1b7c9f4) to head (728bda0).
Report is 3 commits behind head on master.

❗ Current head 728bda0 differs from pull request most recent head 76f9811. Consider uploading reports for the commit 76f9811 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1259   +/-   ##
=======================================
  Coverage   67.28%   67.28%           
=======================================
  Files         174      174           
  Lines        6025     6025           
  Branches      671      671           
=======================================
  Hits         4054     4054           
  Misses       1802     1802           
  Partials      169      169           
Flag Coverage Δ
net6 67.26% <100.00%> (ø)
net7 67.26% <100.00%> (ø)
net8 67.27% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WhitWaldo WhitWaldo changed the title Marked Value property as nullable Marked bulk state Value property as nullable Apr 3, 2024
Copy link
Collaborator

@philliphoff philliphoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding null-ability on a case-by-case basis is probably the best we can do at the moment as, despite being tremendously useful (in my opinion), a SDK-wide review is unlikely to rise to the top of any priority stack.

Thanks for taking a look at this!

@philliphoff philliphoff merged commit 64c2f48 into dapr:master Apr 8, 2024
10 checks passed
@WhitWaldo WhitWaldo deleted the nullable-bulk-state-query-result branch April 8, 2024 23:21
@marcduiker
Copy link
Contributor

@holopin-bot @WhitWaldo Thank you!

Copy link

holopin-bot bot commented Apr 24, 2024

Congratulations @WhitWaldo, you just earned a badge! Here it is: https://holopin.io/claim/clvdvmzf685870fl5k95i2jrb

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

@philliphoff philliphoff added this to the v1.14 milestone Jul 23, 2024
divzi-p pushed a commit to divzi-p/dotnet-sdk that referenced this pull request Dec 10, 2024
…l value (which it will if a key doesn't have any data in the state store). Only enabled nullable annotation on this file for now. (dapr#1259)

Signed-off-by: Whit Waldo <[email protected]>
Co-authored-by: Phillip Hoff <[email protected]>
Signed-off-by: Divya Perumal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetBulkStateAsync returns empty items for missing keys
3 participants