Problem
The with_preamble method currently resets callback handlers to None when called, which can surprise users who have already registered success/failure callbacks.
Location
Lines 90-92 in src/server.rs
Current Behaviour
When a user calls with_preamble after setting callback handlers via on_preamble_decode_success or on_preamble_decode_failure, the previously-set handlers are silently dropped and reset to None.
Suggested Solutions
Either:
- Document the required call order prominently in the API documentation
- Carry the existing Arc<...> callback values across to the new instance to preserve user-set handlers
Context
This issue affects the user experience of the preamble callback API and could lead to unexpected behaviour where callbacks appear to be ignored.
References
Reported by: @leynos
Problem
The
with_preamblemethod currently resets callback handlers to None when called, which can surprise users who have already registered success/failure callbacks.Location
Lines 90-92 in src/server.rs
Current Behaviour
When a user calls
with_preambleafter setting callback handlers viaon_preamble_decode_successoron_preamble_decode_failure, the previously-set handlers are silently dropped and reset to None.Suggested Solutions
Either:
Context
This issue affects the user experience of the preamble callback API and could lead to unexpected behaviour where callbacks appear to be ignored.
References
Reported by: @leynos