mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
fix(bridge): Replace polling with msg_subscribe for real-time messages
Critical fixes based on user feedback:
1. **Remove auto-recv polling (30s interval)**
- Polling with 'recv' doesn't fetch NEW messages, only reads from .msgs
- Wasteful - creates unnecessary command traffic
2. **Add msg_subscribe for real-time message reception**
- meshcli's msg_subscribe enables automatic message events
- Messages arrive via EventType.CHANNEL_MSG_RECV events
- No polling needed - truly asynchronous
3. **Make TZ configurable via .env instead of hardcoded**
- Changed docker-compose.yml: TZ=${TZ:-UTC}
- Added TZ=Europe/Warsaw to .env.example
- Users can now set their own timezone
4. **Remove unused shlex import**
- Not needed after switching to manual double-quote wrapping
Technical details:
- msg_subscribe sends subscription command to meshcli at init
- meshcli then emits events when messages arrive
- Events trigger TTY errors (harmless - meshcli tries to print_above)
- Messages are still saved to .msgs file by meshcli core
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
12
.env.example
12
.env.example
@@ -13,7 +13,7 @@ MC_SERIAL_PORT=/dev/serial/by-id/usb-Espressif_Systems_heltec_wifi_lora_32_v4__1
|
||||
MC_DEVICE_NAME=MarWoj
|
||||
|
||||
# MeshCore configuration directory (where .msgs file is stored)
|
||||
MC_CONFIG_DIR=/root/.config/meshcore
|
||||
MC_CONFIG_DIR=/home/marek/.config/meshcore
|
||||
|
||||
# ============================================
|
||||
# Application Settings
|
||||
@@ -30,7 +30,7 @@ MC_INACTIVE_HOURS=48
|
||||
# ============================================
|
||||
|
||||
# Directory for storing archived messages
|
||||
MC_ARCHIVE_DIR=/mnt/archive/meshcore
|
||||
MC_ARCHIVE_DIR=/home/marek/.config/meshcore/archive
|
||||
|
||||
# Enable automatic daily archiving at midnight
|
||||
MC_ARCHIVE_ENABLED=true
|
||||
@@ -50,3 +50,11 @@ FLASK_PORT=5000
|
||||
|
||||
# Debug mode (true/false) - use false in production
|
||||
FLASK_DEBUG=false
|
||||
|
||||
# ============================================
|
||||
# System Configuration
|
||||
# ============================================
|
||||
|
||||
# Timezone for container logs (default: UTC)
|
||||
# Examples: Europe/Warsaw, America/New_York, Asia/Tokyo
|
||||
TZ=Europe/Warsaw
|
||||
|
||||
Reference in New Issue
Block a user