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
{{ message }}
Repository navigation
fix(printers): validate updates and keep default selection consistent #227
The printer API has several confirmed consistency and validation problems:
Concurrent requests can leave zero or multiple default printers.
Updates accept invalid connection types and port values.
KOT printing does not apply the same JSON field parsing as bill printing.
Deleting the default printer leaves printing unavailable until manual repair.
Updates conflate omitted fields with explicit empty or zero values.
Why this matters
Printing can stop unexpectedly, invalid configuration can be persisted, and KOT output can be incomplete or malformed.
Relevant code
main/routes/printers.ts
main/routes/kitchen-stations.ts
main/thermal.ts
Acceptance criteria
Default-printer changes are atomic and maintain the intended invariant.
PUT validates connection type and port range consistently with POST.
KOT and bill printing use the same effective item/add-on parsing contract.
Deleting a default printer has an explicit safe behavior: prevent deletion or select a valid replacement.
API updates distinguish omitted fields from explicit null/empty/zero values.
Add concurrent and malformed-input regression tests.
Additional confirmed case
The kitchen-station update endpoint accepts an empty printer identifier and allows the database foreign-key error to become HTTP 500 instead of returning a client-validation response.
Activity
test: add API regression coverage for printer and kitchen station rou…