From 62b301ae76c8b554e4bc347b5b109941e0725199 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 12 Jun 2025 21:04:42 -0700 Subject: [PATCH] raylib ui: fix Firehose param caching (#35549) * oof * fixx --- selfdrive/ui/layouts/settings/firehose.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/selfdrive/ui/layouts/settings/firehose.py b/selfdrive/ui/layouts/settings/firehose.py index 864797be6f..ccedf57a93 100644 --- a/selfdrive/ui/layouts/settings/firehose.py +++ b/selfdrive/ui/layouts/settings/firehose.py @@ -51,11 +51,9 @@ class FirehoseLayout(Widget): def _get_segment_count(self) -> int: stats = self.params.get(self.PARAM_KEY, encoding='utf8') - if not stats: - return 0 try: return int(json.loads(stats).get("firehose", 0)) - except (json.JSONDecodeError, TypeError, ValueError): + except Exception: cloudlog.exception(f"Failed to decode firehose stats: {stats}") return 0 @@ -166,9 +164,9 @@ class FirehoseLayout(Widget): if response.status_code == 200: data = response.json() self.segment_count = data.get("firehose", 0) - self.params.put(self.PARAM_KEY, str(self.segment_count)) + self.params.put(self.PARAM_KEY, json.dumps(data)) except Exception as e: - cloudlog.debug(f"Failed to fetch firehose stats: {e}") + cloudlog.error(f"Failed to fetch firehose stats: {e}") def _update_loop(self): while self.running: