@@ -369,11 +369,17 @@ await MaybeWithTransaction(async (session, token) =>
369
369
370
370
private JournalEntry ToJournalEntry ( IPersistentRepresentation message )
371
371
{
372
- object payload = message . Payload ;
372
+ string [ ] tags ;
373
+ var payload = message . Payload ;
373
374
if ( message . Payload is Tagged tagged )
374
375
{
375
376
payload = tagged . Payload ;
376
377
message = message . WithPayload ( payload ) ; // need to update the internal payload when working with tags
378
+ tags = tagged . Tags . ToArray ( ) ;
379
+ }
380
+ else
381
+ {
382
+ tags = Array . Empty < string > ( ) ;
377
383
}
378
384
379
385
// per https://github.com/akkadotnet/Akka.Persistence.MongoDB/issues/107
@@ -392,7 +398,7 @@ private JournalEntry ToJournalEntry(IPersistentRepresentation message)
392
398
PersistenceId = message . PersistenceId ,
393
399
SequenceNr = message . SequenceNr ,
394
400
Manifest = manifest ,
395
- Tags = tagged . Tags ? . ToList ( ) ,
401
+ Tags = tags ,
396
402
SerializerId = null // don't need a serializer ID here either; only for backwards-compat
397
403
} ;
398
404
}
@@ -411,7 +417,7 @@ private JournalEntry ToJournalEntry(IPersistentRepresentation message)
411
417
PersistenceId = message . PersistenceId ,
412
418
SequenceNr = message . SequenceNr ,
413
419
Manifest = string . Empty , // don't need a manifest here - it's embedded inside the PersistentMessage
414
- Tags = tagged . Tags ? . ToList ( ) ,
420
+ Tags = tags ,
415
421
SerializerId = null // don't need a serializer ID here either; only for backwards-compat
416
422
} ;
417
423
}
0 commit comments