Skip to content

Conversation

@johanandren
Copy link
Contributor

@johanandren johanandren commented Oct 16, 2025

@johanandren
Copy link
Contributor Author

Could be that we need more tuning, logging or opt in/out

Copy link
Contributor

@patriknw patriknw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good

serialization
.deserialize(persistentPayload.getPayload.toByteArray, persistentPayload.getSerializerId, manifest)
.get
.toOption
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we have a marker trait to define that the metadata is mandatory and should fail deserialization instead of skipping? Then we have it as default to ignore, but can mark certain things, like ReplicatedEventMetadata.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only have a serializer id and a manifest, no class on the deserializing side when unknown metadata type so we couldn't know that the marker is applied?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, didn't think (that far)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that it could be only for unknown serializer id:s but where we hit it ourselves was there is an existing serializer for protos but the message type is unknown, so that doesn't work well enough either.

@johanandren
Copy link
Contributor Author

Was thinking about logging as a warning on first occurrence per serializer id + manifest, and still ignore, but that wouldn't help our SDK users defining custom metadata, warning would go in runtime logs.

@johanandren
Copy link
Contributor Author

New idea, probably with a toggle to enable, we could collect such failures in a special kind of public API metadata entry, that it is then possible to look for in the events and deal with in a suitable way in a given application.

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.

3 participants