Enhance WebSocket service with polling fallback and improved diagnostics

- Added configuration options for polling fallback and polling interval to the WebSocket service, enabling a backup mechanism for real-time updates when WebSocket connections fail.
- Implemented detailed logging for WebSocket events, including connection status, message handling, and error diagnostics, to improve monitoring and debugging capabilities.
- Updated connection handling to manage polling effectively, ensuring users receive timely updates even during WebSocket disruptions.

These changes enhance the reliability and transparency of the WalletWebSocketService, contributing to a better user experience.
This commit is contained in:
padreug 2025-09-18 11:28:56 +02:00
parent 37a07c0c12
commit ed92c7ba87
2 changed files with 307 additions and 19 deletions

View file

@ -78,7 +78,9 @@ export const appConfig: AppConfig = {
websocket: {
enabled: import.meta.env.VITE_WEBSOCKET_ENABLED !== 'false', // Can be disabled via env var
reconnectDelay: 2000, // 2 seconds (increased from 1s to reduce server load)
maxReconnectAttempts: 3 // Reduced from 5 to avoid overwhelming server
maxReconnectAttempts: 3, // Reduced from 5 to avoid overwhelming server
fallbackToPolling: true, // Enable polling fallback when WebSocket fails
pollingInterval: 10000 // 10 seconds for polling updates
}
}
}