-
Notifications
You must be signed in to change notification settings - Fork 67
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
Multiple serializions and deserializations lead to duplications #107
Comments
Ok, I have a repro case. Let me look into this. I assume the desired behavior is that the contents of the in-memory store, dirty or not, is discarded in favor of the data being deserialized. Would that be your understanding? |
I'd like to understand the use case for this a bit better. The typical usage is to deserialize on launch and then serialize on change. So the second deserialization would typically not happen unless the app were evicted from memory or crashed. In those cases, the data store would begin empty and no dups would appear. Is there a different use case where multiple deserializations are necessary? |
Here is the repo https://github.com/onemanstartup/motion_model_possible_bug
The same behaviour can be replicated in repl. |
After second deserialization for example it doubles counts like for example there were 10 items
Item.all.count #=> 10
and after deserialization it's 20. And every item is with the same ids.Why it can be?
P.S. it seems there is no dup method like in activerecord to create shallow copy of object. Is it needed in library?
The text was updated successfully, but these errors were encountered: