mirror of
https://github.com/Donkie/Spoolman.git
synced 2026-10-22 01:52:17 -05:00
Fixes #1019. A dashboard card grouped by a custom spool field counted more spools than it listed: the group aggregate summed them, the card's own query returned a subset. Grouping and filtering disagreed about what "no value" means. group_by keys on the decoded value, so a spool holding the JSON empty string a cleared text box writes became its own group, separate from the null one; the client renders both as "unassigned" and adds the counts. The card then fetches its spools with `extra.<key>=`, whose empty branch matched only NULL and JSON null - never the empty string. Built-in string columns have matched both NULL and '' since forever (add_where_clause_str_opt), which is why grouping by location was fine. - The empty extra-field filter matches a stored empty string too. - Value-keyed group axes (extra fields, location, material) fold a blank into NULL, so "unassigned" is one group rather than two the client can only draw as one. - Emptying a text extra field clears it instead of storing "", so no new spool lands in the state above. - The dashboard clears an extra field with a real JSON null. It sent the string 'null', which the API rejects as not-a-string, so dragging a spool onto the unassigned card 400'd on every extra-field board.