fix(dab): inject mode='DAB' into cached metadata replay in setMetaWriter

Without this, DabMetaPanel.isSupported() in the JS client returns false
(it checks data.mode === 'DAB') and silently discards the replayed
programme list. Clients connecting after the _meta_buffer ring has
wrapped — i.e. any reconnect more than ~15s after startup — would never
see the programme list, showing 'Loading...' indefinitely.

MetaProcessor intentionally excludes 'mode' from cached_output (it's a
constant, not stable programme data), but setMetaWriter must re-inject
it when replaying the cache. MetaForwarder already does this for every
live packet — this makes the one-shot replay consistent with it.

Root cause traced on veridooh-syd-2 via diagnostic logging: cache was
always populated (has_programmes=True on every connect) but Chrome
ignored every replay. JS source confirmed the mode check is the gate.
This commit is contained in:
Denny 2026-03-18 11:18:35 +11:00
parent 02a3fd565e
commit 70724422cd

View file

@ -179,6 +179,7 @@ class Dablin(BaseDemodulatorChain, FixedIfSampleRateChain, FixedAudioRateChain,
cached = self._shared_decoder.getCachedMeta()
if cached:
import pickle
cached['mode'] = 'DAB' # required: JS DabMetaPanel.isSupported() checks data.mode
writer.write(pickle.dumps(cached))
def setDabServiceId(self, serviceId: int) -> None: