Skip to content

Type the taskLog rows that were landing empty (schema 282) - #1214

Merged
mastacontrola merged 1 commit into
dev-branchfrom
fix-tasklog-untyped-rows-15
Aug 19, 2026
Merged

Type the taskLog rows that were landing empty (schema 282)#1214
mastacontrola merged 1 commit into
dev-branchfrom
fix-tasklog-untyped-rows-15

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Port of #1213's first half. (The other half is a UI tab 1.5 does not have.)

Schema 280 gave logType a DEFAULT 'state', and that step said the existing writer could therefore be left alone. It cannot: a column default applies only when the column is absent from the INSERT, and FOGController::save() writes every declared field — so TaskingElement::taskLog(), which has recorded task state changes since long before this column existed and sets no type, has been storing '' ever since the field was declared.

Found on 1.6 against a live install, where such a row appeared the moment a task was created. The code here is identical, so the defect is too.

  • TaskLog::__construct() types the row itself, guarded on it being empty so loading an existing row and saving it cannot retype it
  • schema 282 repairs the rows the gap produced

Less visible on 1.5 than on 1.6, which has a pane that filters on the type; here it is simply the difference between a stored value that says what a row is and one that says nothing.

Two assertions, both mutation-tested. Full suite green.

Ported from 1.6 #1213. Schema 280 gave `logType` a DEFAULT of 'state' and
that step said the existing writer could be left alone, since the default
would cover it. It does not: a column default applies only when the column
is absent from the INSERT, and FOGController::save() writes every declared
field -- so TaskingElement::taskLog(), which has recorded task state changes
since long before this column existed and sets no type, has been storing ''
ever since the field was declared.

Found on 1.6 against a live install, where one such row appeared as soon as
a task was created; the code is identical here, so the defect is too.

TaskLog::__construct() now types the row itself, guarded so that loading an
existing row and saving it cannot retype it, and schema 282 repairs what the
gap produced. Two assertions, both mutation-tested.

Less visible on 1.5 than on 1.6, which has a pane that filters on the type;
here it is the difference between a stored value that says what a row is and
one that says nothing.

Co-Authored-By: Claude <noreply@anthropic.com>
@mastacontrola
mastacontrola merged commit d6fef1e into dev-branch Aug 19, 2026
3 checks passed
@mastacontrola
mastacontrola deleted the fix-tasklog-untyped-rows-15 branch August 19, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants