From c45f31c721991b67c1c62a236cf6b12bc8cfaf66 Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Tue, 8 Oct 2019 10:19:27 -0500 Subject: [PATCH] fail JournalSerializationSpec.Journal_should_serialize_Persistent_with_EventAdapter_manifest doesn't make sense --- .../Journal/QueryExecutor.cs | 21 +++++++++++-------- .../SqliteJournalSerializationSpec.cs | 5 ----- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs index 3f725cbdf3b..cb588b8b406 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/QueryExecutor.cs @@ -691,19 +691,22 @@ protected virtual void WriteEvent(DbCommand command, IPersistentRepresentation e var serializer = Serialization.FindSerializerForType(payloadType, Configuration.DefaultSerializer); // TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811 - string manifest = ""; + string manifest = e.Manifest; var binary = Akka.Serialization.Serialization.WithTransport(Serialization.System, () => { - - if (serializer is SerializerWithStringManifest stringManifest) - { - manifest = stringManifest.Manifest(e.Payload); - } - else + + if (string.IsNullOrEmpty(manifest)) { - if (serializer.IncludeManifest) + if (serializer is SerializerWithStringManifest stringManifest) { - manifest = e.Payload.GetType().TypeQualifiedName(); + manifest = stringManifest.Manifest(e.Payload); + } + else + { + if (serializer.IncludeManifest) + { + manifest = e.Payload.GetType().TypeQualifiedName(); + } } } diff --git a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Serialization/SqliteJournalSerializationSpec.cs b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Serialization/SqliteJournalSerializationSpec.cs index d69e2e931fd..f21c7a8f35e 100644 --- a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Serialization/SqliteJournalSerializationSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Serialization/SqliteJournalSerializationSpec.cs @@ -46,10 +46,5 @@ class = ""Akka.Persistence.Sqlite.Journal.SqliteJournal, Akka.Persistence.Sqlite } }"); } - - [Fact(Skip = "Sql plugin does not support EventAdapter.Manifest")] - public override void Journal_should_serialize_Persistent_with_EventAdapter_manifest() - { - } } }