prosgarz35 commented on PR #3198:
URL: https://github.com/apache/james-project/pull/3198#issuecomment-5825899002
Pushed a follow-up commit finalizing the identity-aware listener
lifecycle and contract documentation:
1. **Identity-Safe Unregistration Unit Coverage**:
- Added unit tests in `SelectedMailboxImplTest`:
- `unregisterIdleWithMatchingListenerShouldClearIdleState`:
verifies clean unregistration of active listeners.
- `unregisterIdleWithStaleListenerShouldNotClearNewListener`:
explicitly verifies that a delayed cleanup of a previous listener A never
clears a newly registered listener B.
2. **Safe Reference Publishing**:
- Reordered listener registration so
`idleListenerRef.set(idleListener)` occurs strictly after
`selectedMailbox.registerIdle(idleListener)` succeeds, preventing stale
reference leaks on unexpected registration errors.
3. **API Contract Documentation**:
- Documented the contract and fallback semantics of
`SelectedMailbox.unregisterIdle(ReactiveEventListener)` via detailed Javadoc.
--
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]