From 4d239008a6c5f9a77d25dfc72523935279f66bbd Mon Sep 17 00:00:00 2001 From: Will Miao Date: Mon, 8 Jun 2026 13:58:21 +0800 Subject: [PATCH] fix(update): respect hide_early_access_updates in refresh toast count The refresh_model_updates handler was calling record.has_update() with default hide_early_access=False, causing the toast to report early-access updates that the Updates filter (which uses the user's hide_early_access setting) would then hide. This resulted in misleading "Found N updates" toasts followed by an empty Updates view. Now the handler reads hide_early_access_updates from settings and passes it to has_update(), matching the behavior of _serialize_record and _annotate_update_flags. --- py/routes/handlers/model_handlers.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/py/routes/handlers/model_handlers.py b/py/routes/handlers/model_handlers.py index d38ad34b..545da08b 100644 --- a/py/routes/handlers/model_handlers.py +++ b/py/routes/handlers/model_handlers.py @@ -2016,10 +2016,21 @@ class ModelUpdateHandler: self._logger.error("Failed to refresh model updates: %s", exc, exc_info=True) return web.json_response({"success": False, "error": str(exc)}, status=500) + hide_early_access = False + if self._settings is not None: + try: + hide_early_access = bool( + self._settings.get("hide_early_access_updates", False) + ) + except Exception: + pass + serialized_records = [] for record in records.values(): has_update_fn = getattr(record, "has_update", None) - if callable(has_update_fn) and has_update_fn(): + if callable(has_update_fn) and has_update_fn( + hide_early_access=hide_early_access + ): serialized_records.append(self._serialize_record(record)) return web.json_response(