You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/09/24 07:56:31 UTC

[PR] Map replicated entity ids in consumer filters with the entity type [pekko-projection]

pjfanning opened a new pull request, #637:
URL: https://github.com/apache/pekko-projection/pull/637

   ### Motivation
   `FilterStage.mapEntityIdToPid` builds the persistence id for entity ids in consumer filter criteria (`IncludeEntityIds`, `ExcludeEntityIds`, etc.). For plain entity ids it uses the stream's `entityType`, but for replicated entity ids (containing the `|` separator) it used the `streamId`. That works when the stream id equals the entity type name, which is the default for Replicated Event Sourcing, but not when `ReplicationSettings.withStreamId` is used: the constructed persistence id then has the wrong type name, so the slice check and replay query don't match any events.
   
   ### Modification
   Use `entityType` in both branches of `mapEntityIdToPid`, in line with the comment above it.
   
   ### Result
   `IncludeEntityIds` and `ExcludeEntityIds` with replicated entity ids work regardless of the stream id.
   
   ### Tests
   - `sbt grpc-test/test` - passed
   - New `FilterStageSpec` test "map replicated entity ids in filter criteria with the entity type" fails without the change (the spec already uses a stream id that differs from the entity type)
   - `sbt grpc/Compile/scalafmtCheck grpc-test/Test/scalafmtCheck` - passed
   - MiMa not run - no `mimaReportBinaryIssues` task for the grpc module; change is internal only
   
   ### References
   Fixes #634
   


-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org