-
Notifications
You must be signed in to change notification settings - Fork 266
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
Fix YAML serialization #508
Conversation
I'd need to examine the values, but maybe we could use a symbol or number instead of a singleton object instance? Then we don't need to implement the yaml coder stuff |
Yes and no. It would work for newly serialized objects, however if you have some serialized |
Ref: sporkmonger#486 Following the introduction of `NONE` flags, `Addressable::URI` instance can no longer be correctly serialized with YAML. It appear to work, but `NONE` is serialized as `!ruby/object {}`, so when the YAML is parsed back, the attributes are assigned a distinct anonymous object.
07715c7
to
ed47f3a
Compare
Is #509 needed if this is merged? |
@tenderlove did you have any other idea or are you okay with this? |
@dentarg I don't have any better ideas, I think we should merge this 😅 |
This help treating caches entries as expandable. Because Marshal will hapily serialize almost everything, It's not uncommon to inadvertently cache a class that's not particularly stable, and cause deserialization errors on rollout when the implementation changes. E.g. sporkmonger/addressable#508 With this change, in case of such event, the hit rate will suffer for a bit, but the application won't return 500s responses.
Ref: #486
Following the introduction of
NONE
flags,Addressable::URI
instance can no longer be correctly serialized with YAML.It appear to work, but
NONE
is serialized as!ruby/object {}
, so when the YAML is parsed back, the attributes are assigned a distinct anonymous object.FYI: @tenderlove