-
Notifications
You must be signed in to change notification settings - Fork 337
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
GetStateAsync throws exception if key not found when using json contentType #999
Comments
@MargaretKrutikova - I think we're supposed to return null instead of erroring out. How exactly are you setting the metadata? The format of |
I apologize for the late reply, this how we are doing it: Dictionary<string, string> metadata = new() { { "contentType", "application/json" } };
var data = await daprClient.GetStateAsync<SomeData>(config.StoreName, dataId, metadata: metadata); Is there anything we are missing here? |
Hello, I have the same problem. Thanks! |
We have also started to get this issue, also after adding the "contentType", "application/json" metadata so we could use querying with redis |
I encountered the same issue. I noticed that the message "fail to get test from state store statestore: redis: nil" is returned from Dapr's
|
Ask your question here
I am using
redis
for state store component withRedisJSON
module, and when getting state withcontentType
metadata set toapplication/json
, methodGetStateAsync
on the dapr client throws the following exception if the key doesn't exist:Is this an intended behavior or more like a bug? When not using any metadata the return value from
GetStateAsync
isnull
with no exception thrown if the key doesn't exist.Thanks!
The text was updated successfully, but these errors were encountered: