Skip to content

Conversation

@Aaronontheweb
Copy link
Member

Summary

Adds a runtime test that reproduces the event adapter regression reported in issue #552.

Problem

Event adapters configured via WithSqlPersistence() stop working in v1.5.51.1 when the method is called multiple times (e.g., once for default persistence with adapters, then again for sharding configuration).

Test Results

  • v1.5.51: Test PASSES - event adapters work correctly
  • v1.5.51.1: Test FAILS with timeout - EventsByTag queries return no results because events aren't tagged

Root Cause

The issue is in Akka.Hosting's dual registration pattern (adapters serialize via both ToConfig() AND callback's Build()). This is being fixed in akkadotnet/Akka.Hosting#669.

Test Details

RuntimeEventAdapterSpec.cs mimics the user's exact scenario:

  1. First call: WithSqlPersistence() with journalBuilder that adds event adapters for tagging
  2. Second call: WithSqlPersistence() with separate journal/snapshot options for sharding (isDefaultPlugin: false)
  3. Attempts to query events by tag - should succeed but times out on v1.5.51.1

Related

@Aaronontheweb Aaronontheweb force-pushed the feature/runtime-event-adapter-test branch from 8d4ebdf to 8603699 Compare October 10, 2025 19:09
…rations

This test reproduces the scenario from issue akkadotnet#552 where:
1. WithSqlPersistence is called with event adapters (for tagging)
2. WithSqlPersistence is called again with separate journal/snapshot options (for sharding)

The test uses Akka.Hosting.TestKit for cleaner lifecycle management and follows
the same pattern as other end-to-end tests in the project.

Test verifies:
- Creates a persistent actor
- Persists events that should be tagged by the event adapter
- Queries by tag using EventsByTag
- Asserts that all 3 events are found with the correct tag

On v1.5.51: TEST PASSES ✓
Event adapters work correctly even with multiple WithSqlPersistence calls.

Next step: Test on v1.5.51.1 to see if regression exists.
@Aaronontheweb Aaronontheweb force-pushed the feature/runtime-event-adapter-test branch from 8603699 to eb68d0f Compare October 10, 2025 19:12
This upgrade includes the fix from Akka.Hosting PR #669 which removes
dual registration of event adapters. The HOCON configuration now correctly
includes event adapters, though the runtime test still requires investigation.
This test reproduces the event adapter regression reported in issue akkadotnet#552
where event tagging stopped working after updating from v1.5.51 to v1.5.51.1.

The test uses the NEW callback API pattern (journalBuilder parameter) which
matches the user's actual code from their reproduction. This demonstrates that
the NEW callback API for event adapters has been broken since v1.5.51.1 when
followed by WithJournalAndSnapshot().

Test results:
- EventAdapter_ShouldWork_OnDefaultJournal: FAILS (adapter called 0 times)
- EventAdapter_ShouldWork_OnShardingJournal_ReproducesUserScenario: FAILS (adapter called 0 times)

The test configuration mimics the user's scenario:
1. WithSqlPersistence() with journalBuilder callback to add event adapters
2. WithJournalAndSnapshot() for sharding configuration

While adapters appear in HOCON configuration, they are never invoked at runtime.

Related to akkadotnet#552
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.

1 participant