hanishi opened a new issue, #2579:
URL: https://github.com/apache/pekko/issues/2579

    ## Summary
   The [DurableStateBehavior 
documentation](https://pekko.apache.org/docs/pekko/current/typed/durable-state/persistence.html)
 doesn't mention the `RecoveryCompleted` signal or show the correct import 
path. This leads to a subtle bug when users copy patterns from 
EventSourcedBehavior examples.
   
     ## Problem
   
     `DurableStateBehavior` and `EventSourcedBehavior` have **different** 
`RecoveryCompleted` signals in different packages:
   
     | Behavior | Signal Import |
     |----------|---------------|
     | `EventSourcedBehavior` | 
`org.apache.pekko.persistence.typed.RecoveryCompleted` |
     | `DurableStateBehavior` | 
`org.apache.pekko.persistence.typed.state.RecoveryCompleted` |
   
   This introduced a subtle bug in my code: when I used the wrong import, the 
pattern match failed silently. The signal handler never triggered, but:
     - The code compiled without errors
     - No runtime exception was thrown
     - The signal was not matched
   
     ## Questions
   
     1. **Is there a reason these are separate types?** They seem to serve the 
same purpose.
   
     2. **Could they be unified?** A single `RecoveryCompleted` signal would 
prevent this mistake.
   
     3. **If they must remain separate, could the compiler warn?** Perhaps a 
sealed trait or exhaustiveness check could help catch this at compile time.
   
     4. **At minimum, should the DurableStateBehavior docs mention this?** The 
current docs don't show `receiveSignal` usage or the correct import.
   
     ## Environment
     - Pekko version: 1.1.x
     - Scala 3.3.x
   
   
   
    


-- 
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