Skip to content
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

calling .save on a nested obj is not working on 3.10.0 #814

Closed
rhuang opened this issue Oct 11, 2024 · 2 comments
Closed

calling .save on a nested obj is not working on 3.10.0 #814

rhuang opened this issue Oct 11, 2024 · 2 comments

Comments

@rhuang
Copy link

rhuang commented Oct 11, 2024

my_obj.metadata[:some][:path][:count] = 5
my_obj.save # this does not actually trigger an `UPDATE` request

my_obj.fubar = 'something else'
my_obj.save # this triggers an `UPDATE` request

On 3.8.0, calling .save triggers a PUT for both scenarios above.
On 3.8.0, if you change nested attributes like my_obj.metadata[:some][:path][:count] = 5, calling my_obj.changes afterwards returns an empty hash.

For context, I was operating on the same object but different columns, from 2 different threads, and realized one thread was overriding the other because .save calls PUT, so I was checking if I can get Dynamoid to call UPDATE to avoid this issue.

@andrykonchin
Copy link
Member

andrykonchin commented Oct 11, 2024

Yeah, it's a known issue. Changes in a nested object (e.g. of a custom type, or serialized /map/array types) aren't detected and don't trigger persisting.

There are already issues for it: #666, #749, #738

@rhuang
Copy link
Author

rhuang commented Oct 11, 2024

Ah, sorry for the dup. I will close and follow the others.

@rhuang rhuang closed this as completed Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants