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
While testing performance of a local project using RedisOM and GraphQL, I encountered a difference in the behavior of Redis that leads to a System.Text.Json.JsonException during deserialization. Specifically, when enumerating the RedisCollection without projection, I encountered no issues; an example of the Redis query and response is below:
Running a similar query with a projection from GraphQL against the same Redis Db produced a different result, however, as well as the exception:
Query: FT.SEARCH graph3_user_index * LIMIT 0 11 RETURN 18 UserId AS UserId Email AS Email FirstName AS FirstName LastName AS LastName DisplayName AS DisplayName IsApproved AS IsApproved SORTBY UserId ASC
Response (first record):
[
"UserId",
"<obfuscated>",
"Email",
"[email protected]",
"FirstName",
"nsqsltsac",
"LastName",
"laste",
"DisplayName",
"nsqsltsac laste",
"IsApproved",
"0"
]
Of particular not is that in this case, IsApproved was returned as a number instead of as a string. During deserialization, this resulted in the JsonException, with the inner exception "InvalidOperationException: Cannot get the value of a token type 'Number' as a boolean".
Is this a known issue? I've created a fork of RedisOM and added some code to
Not a case I've ever run into before, probably do need something in the object handler to handle this particular case. What you have posted above looks roughly correct.
mfaulcon
pushed a commit
to mfaulcon/redis-om-dotnet
that referenced
this issue
Feb 7, 2025
While testing performance of a local project using RedisOM and GraphQL, I encountered a difference in the behavior of Redis that leads to a System.Text.Json.JsonException during deserialization. Specifically, when enumerating the RedisCollection without projection, I encountered no issues; an example of the Redis query and response is below:
Running a similar query with a projection from GraphQL against the same Redis Db produced a different result, however, as well as the exception:
Of particular not is that in this case, IsApproved was returned as a number instead of as a string. During deserialization, this resulted in the JsonException, with the inner exception "InvalidOperationException: Cannot get the value of a token type 'Number' as a boolean".
Is this a known issue? I've created a fork of RedisOM and added some code to
redis-om-dotnet/src/Redis.OM/RedisObjectHandler.cs
Line 500 in 7f43b7b
The text was updated successfully, but these errors were encountered: