Skip to content

Snapshot is being deserialized before snapshot_module_version is validated #373

Description

@stefanluptak

I am using custom serializer for my EventStore.
The deserialize/2 function is unable to deserialize a snapshot with snapshot_module_version = n - 1 if snapshot_version in the snapshotting configuration is equal to n. In other words: it's not backward compatible.

Currently, when trying to read snapshot when rebuilding aggregate state, the snapshot is read, deserialized and the version is checked against the configured one.
Of course, this doesn't work for me, because as soon as the snapshot is sent to the deserialize/2 function, it raises an exception.

I am not sure if I am using the custom serializer incorrectly, so please correct me, if I am wrong. I thought that the snapshot retrieval could use some JSON(B) querying to return nil if there's no snapshot in the EventStore with the current version.
This could skip the useless deserialization if the snapshot is already old.

If I am thinking correctly, I could try to implement this myself. If not, then thanks for the clarification in advance. :-)

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions