-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
Version Information
all current (1.5.51.1 / 1.5.52)
Describe the bug
When updating Akka.Persistence.Sql.Hosting from 1.5.51 to 1.5.51.1, some tests fail. One of them relies on a message getting tagged and showing up in a stream. It does before the update but not after.
To Reproduce
- send a SubscribeCommand to the SubscriptionActor
- that produces and persists a SubscribedEvent
- the event gets tagged with "Subscription"
- SubscriptionListActor maintains a stream looking for that tag and the event should show up there
Expected behavior
in 1.5.51 the event is in the stream
Actual behavior
in 1.5.51.1 it's not
Environment
Windows, VS 2022, Resharper's Nunit Runner, Sqlite
Additional context
the tagger is configured here:
.WithSqlPersistence( connectionString,
providerName,
useWriterUuidColumn: true,
journalBuilder: journalBuilder =>
{
journalBuilder.AddWriteEventAdapter<MessageTagger>( "status-tagger",
[
typeof(ISubscriptionEvent)
] );
} )
the SubscriptionActor lives in a shard region
.WithShardRegion<SubscriptionActor>( "subscriptions",
( _, _, dependencyResolver ) => entityId => dependencyResolver.Props<SubscriptionActor>( entityId ),
new MessageExtractor( 10 ),
new()
{
RememberEntities = true,
Role = "core",
JournalOptions = shardingJournalOptions,
SnapshotOptions = shardingSnapshotOptions,
RememberEntitiesStore = RememberEntitiesStore.Eventsourced,
StateStoreMode = StateStoreMode.DData,
} )
this is the tagger
internal sealed class MessageTagger : IWriteEventAdapter
{
public const string SUBSCRIPTION_TAG = "Subscription";
#region IWriteEventAdapter
public string Manifest(object evt) => string.Empty;
public object ToJournal(object @event)
{ // <- breakpoint here is never hit in 1.5.51.1
switch (@event)
{
case ISubscriptionEvent subscriptionEvent:
return subscriptionEvent.HasStreamer() && subscriptionEvent.HasSubscriber() ? new Tagged( @event, new[] { SUBSCRIPTION_TAG } ) : @event;
default:
return @event;
}
}
#endregion
}
Metadata
Metadata
Assignees
Labels
No labels