fix(scheduler): default require_plate_clear to False to match schema/UI (#1865)

check_queue() read the plate-clear setting with _get_bool_setting(default=True),
but SettingsSchema.require_plate_clear defaults False and the whole frontend
treats a missing value as off. Since _get_bool_setting returns its default when
no DB row exists, installs that never saved the setting enforced the plate-clear
gate the UI showed as disabled — FINISH-state printers never dispatched and no UI
control existed to clear awaiting_plate_clear. Read the setting with default=False
so the enforced behavior matches the schema and the toggle. Both defaults shipped
together in #752; this aligns them.
This commit is contained in:
maziggy
2026-07-07 10:07:47 +02:00
parent 1d344a8536
commit 45f0ba47db
3 changed files with 161 additions and 2 deletions
+8 -2
View File
@@ -234,8 +234,14 @@ class PrintScheduler:
)
items = list(result.scalars().all())
# Read plate-clear setting once per queue check
require_plate_clear = await self._get_bool_setting(db, "require_plate_clear", default=True)
# Read plate-clear setting once per queue check. Default MUST be
# False to match the schema (SettingsSchema.require_plate_clear
# defaults False) and the frontend (toggle + card badge both treat a
# missing value as off). When no settings row exists, a True default
# here re-enabled the plate-clear gate the UI showed as disabled,
# blocking dispatch to FINISH-state printers forever with no UI path
# to clear it (#1865).
require_plate_clear = await self._get_bool_setting(db, "require_plate_clear", default=False)
if not items:
# No pending items — still check auto-drying on idle printers