JsonIReadOnlyListHintDdbConverter crashes when BufferLengthHint is not available
See original GitHub issueHi,
I noticed problem during ToResponseAsync usage, JsonIReadOnlyListHintDdbConverter crashes during Items element deserialization
Code: context.Query<T> . . ToResponseAsync();
In JSON response Count element is after Items element, it causes that BufferLengthHint is 0 during deserialization. JsonIReadOnlyListHintDdbConverter is not prepared for this, it work with JsonListHintDdbConverter
Below patch with potential fix, please let me know if you accept such fix, I’ll create PR
diff --git a/src/EfficientDynamoDb/Operations/Query/IterableResponse.cs b/src/EfficientDynamoDb/Operations/Query/IterableResponse.cs
--- a/src/EfficientDynamoDb/Operations/Query/IterableResponse.cs (revision 566695abf18e7fa324618d6f933814a4b6f03ae5)
+++ b/src/EfficientDynamoDb/Operations/Query/IterableResponse.cs (date 1661323032101)
@@ -75,7 +75,7 @@
/// <summary>
/// An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.
/// </summary>
- [DynamoDbProperty("Items", typeof(JsonIReadOnlyListHintDdbConverter<>))]
+ [DynamoDbProperty("Items", typeof(JsonListHintDdbConverter<>))]
public IReadOnlyList<TEntity> Items { get; set; } = null!;
}
}
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
"Buffer size must be an integer multiple of the buffer_scale" ...
Describe the bug About 50% of the time when starting a new terminal I get the following crash message immediately: $ kitty wl_surface@3: ......
Read more >How To Fix FL Studio Crashes - YouTube
FL Studio is a truly amazing software which in my experience is mostly stable and professional. Unfortunately for some this just isn't the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @zbyszekpy
Sorry for the delay. We prefer using the old converter for the cloud version because it has lower overhead. I’ve added a fix in #198. I’m going to do some testing and benchmarks to prevent performance degradation for the common path. Hopefully, we’ll be able to merge it later this week.
@zbyszekpy hey, the fix is merged and now available in version 0.9.14-alpha.0.5