fix: prevent dangling XMPP connections during configuration updates

- Add getConfiguration() methods to both bridges for thread-safe config access
- Refactor UpdateConfiguration() methods to prevent mutex deadlock by releasing lock before blocking operations
- Fix XMPP bridge to properly disconnect existing bridgeClient before creating new one
- Add comprehensive timeout support to XMPP client (30s connection, 10s operations, 5s ping)
- Implement proper disconnection with offline presence
- Update all interfaces to use *config.Configuration for type safety

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-08-04 19:04:43 +02:00
parent 65038fb7a2
commit 69a67704f4
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
6 changed files with 121 additions and 55 deletions

View file

@ -110,7 +110,7 @@ type BridgeManager interface {
// OnPluginConfigurationChange propagates configuration changes to all registered bridges.
// Returns an error if any bridge fails to update its configuration, but continues to
// attempt updating all bridges.
OnPluginConfigurationChange(config any) error
OnPluginConfigurationChange(config *config.Configuration) error
// CreateChannelMapping is called when a channel mapping is created.
CreateChannelMapping(req CreateChannelMappingRequest) error
@ -121,7 +121,7 @@ type BridgeManager interface {
type Bridge interface {
// UpdateConfiguration updates the bridge configuration
UpdateConfiguration(config any) error
UpdateConfiguration(config *config.Configuration) error
// Start starts the bridge
Start() error