pjfanning opened a new pull request, #510:
URL: https://github.com/apache/pekko-persistence-r2dbc/pull/510

   ### Motivation
   Port of 
[akka/akka-persistence-r2dbc#416](https://github.com/akka/akka-persistence-r2dbc/pull/416)
 (`feat: Turn filtered payload into filtered envelopes`).
   
   The code is copied from the akka-persistence-r2dbc 1.2.0 release, which is 
available under the Apache License, Version 2.0 as of 2026-10-24 (its LICENSE 
change date).
   
   Events persisted as `FilteredPayload` (e.g. by replicated event sourcing 
filters) are emitted by the slice queries as envelopes carrying the 
`FilteredPayload` object, with `filtered = false`. Consumers cannot tell them 
apart from real events.
   
   ### Modification
   - `R2dbcReadJournal` compares the row's event serializer id with the 
`FilteredPayload` serializer id when creating `EventEnvelope`s 
(`eventsBySlices`, `currentEventsBySlices`, typed `eventsByPersistenceId`, 
`loadEnvelope`). Filtered envelopes get `filtered = true` and no event.
   - The backtracking query now selects `event_ser_id` (`QueryDao` and 
`MySQLQueryDao`) instead of returning `serId = 0`, so backtracking envelopes 
are marked as well. Upstream did this in its Postgres/H2 DAOs; the MySQL change 
is Pekko-specific.
   - A small `deserializePayload` helper replaces the repeated deserialization 
code.
   
   ### Result
   `FilteredPayload` events are surfaced as filtered envelopes without a 
payload, from both normal and backtracking queries.
   
   ### Tests
   - `sbt "core/testOnly *EventsBySliceSpec *EventsBySliceBacktrackingSpec"`: 
the new tests (`mark FilteredPayload as filtered with no payload when reading 
it`, from upstream, for Current and Live; `mark FilteredPayload as filtered in 
backtracking results`, new) fail before the fix and pass after it (PostgreSQL)
   - `sbt core/test`: 360 succeeded, 0 failed (PostgreSQL in docker)
   - `sbt core/mimaReportBinaryIssues`: no issues
   - scalafmt, `git diff --check`
   - MySQL not run locally
   
   ### References
   Refs akka/akka-persistence-r2dbc#416


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to