Skip to content

Conversation

@IngridMorstrad
Copy link
Contributor

Why is the change being made?

Clojure Fressian has a bug when serializing maps, see here for details:
clojure/data.fressian#14

This means users of DynamicObject have to serialize dynamic objects at least twice
(serialize -> deserialize -> serialize)
to get a consistent serialization.

What has changed to address the problem?

Changed FressianSerialization to create a PersistentHashMap if we are writing a map of size 8. This ensures that every serialization of a dynamic object returns the same value.

How was this change tested?

Test-driven development. Reproduced the bug via a unit test.

Things to consider

We may want to consider whether this introduces issues as the first serialization with this commit will be different compared to the first Fressian serialization without this commit.

 ## Why is the change being made?
Clojure Fressian has a bug when serializing maps, see
here for details:
clojure/data.fressian#14

This means users of DynamicObject have to serialize
dynamic objects at least twice
(serialize -> deserialize -> serialize)
to get a consistent serialization.

 ## What has changed to address the problem?
Changed FressianSerialization to create a PersistentHashMap if
we are writing a map of size 8. This ensures that every
serialization of a dynamic object returns the same value.

 ## How was this change tested?
Test-driven development. Reproduced the bug via a unit test.
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

Successfully merging this pull request may close these issues.

1 participant