Open ckhsponge opened 1 month ago
Nice catch.
It seems transactions don't take into account the Dynamoid.config.store_attribute_with_nil_value
config option, that is false
by default.
Just for the record - I am planning to remove store_attribute_with_nil_value
option (and to store nil
values unconditionally) and some other legacy options that are needed only for compatibility reasons in the next major release.
But this is an interesting case so probably store_attribute_with_nil_value
might be still useful and the global store_attribute_with_nil_value
option should be replaced with a field-specific one (when a field is a part of a GSI).
Thanks for the clarification on this. For DynamoDB, I would have preferred for a blank value to be able to be stored and just have the record omitted from from the GSI. Looks like that is not allowed.
I'll try to get a fix for this. And a test so you're future work doesn't break it ;)
@andrykonchin I found the problem. Previously there were some sanitize_item calls in there.
Here's my first stab at a fix: https://github.com/Dynamoid/dynamoid/pull/897
Thank you. I've left some comments.
@andrykonchin I found this bug. I think the transaction code needs to remove the value instead of trying to set it to null. I'll try to find a fix. I feel like this wasn't happening in earlier transaction code but perhaps it was.