question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JsonIReadOnlyListHintDdbConverter crashes when BufferLengthHint is not available

See original GitHub issue

Hi,

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:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
firenerocommented, Sep 13, 2022

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.

0reactions
firenerocommented, Sep 20, 2022

@zbyszekpy hey, the fix is merged and now available in version 0.9.14-alpha.0.5

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found