You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: skip active discovery when retained messages already provide enough metrics
When MQTT broker has retained messages from a running OVMS module, those
messages arrive immediately after SUBACK, often before the connection loop
completes. In beta4, the metric_topics_before count was taken AFTER those
retained messages arrived, causing the 'new metrics' count to be 0.
This fix adds an early check: if we already have >= 50 metric topics from
retained messages, skip both active discovery AND legacy wait entirely.
This returns discovery to ~instant completion for users with retained msgs.
Timeline issue (from debug logs):
- 05:23:54.300: SUBACK received
- 05:23:54.316-586: 172 retained metric messages arrive
- 05:24:04.735: new_metric_topics = 0 → 'No metric topics' → legacy fallback
- 05:24:54.816: Discovery complete (60s total, 50s wasted)
With this fix:
- Check metric_topics_before FIRST
- If >= GOOD_DISCOVERY_TOPICS (50), skip active/legacy phases
- Discovery completes in ~1s instead of 60s
0 commit comments