feat: implement TTL cache for message deduplication and remove debug logging

- Replace manual map-based deduplication with jellydator/ttlcache/v3
- Add automatic cache eviction with 30-second TTL to prevent memory bloat
- Implement proper cache lifecycle management (start/stop)
- Remove emoji debug logs from bridge system and XMPP client
- Clean up verbose logging while maintaining essential error handling
- Update bridge interface method names for consistency

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Felipe M 2025-08-05 12:19:44 +02:00
parent 7b56cb34c6
commit eb852662f7
No known key found for this signature in database
GPG key ID: 52E5D65FCF99808A
9 changed files with 163 additions and 105 deletions

View file

@ -73,6 +73,9 @@ func (r DeleteChannelMappingRequest) Validate() error {
}
type BridgeManager interface {
// Start starts the bridge manager and message routing system.
Start() error
// RegisterBridge registers a bridge with the given name. Returns an error if the name is empty,
// the bridge is nil, or a bridge with the same name is already registered.
RegisterBridge(name string, bridge Bridge) error
@ -138,11 +141,11 @@ type Bridge interface {
// DeleteChannelMapping removes a mapping between a Mattermost channel ID and a bridge room ID.
DeleteChannelMapping(channelID string) error
// RoomExists checks if a room/channel exists on the remote service.
RoomExists(roomID string) (bool, error)
// ChannelMappingExists checks if a room/channel exists on the remote service.
ChannelMappingExists(roomID string) (bool, error)
// GetRoomMapping retrieves the Mattermost channel ID for a given room ID (reverse lookup).
GetRoomMapping(roomID string) (string, error)
// GetChannelMappingForBridge retrieves the Mattermost channel ID for a given room ID from a specific bridge.
GetChannelMappingForBridge(bridgeName, roomID string) (string, error)
// IsConnected checks if the bridge is connected to the remote service.
IsConnected() bool