Skip invalid notes CLI item rows (#2005)

This commit is contained in:
red person
2026-06-29 06:26:46 -07:00
committed by GitHub
parent dff79319d7
commit a326a6a555
2 changed files with 25 additions and 1 deletions
+22
View File
@@ -46,3 +46,25 @@ def test_serialize_keeps_list_note_items(monkeypatch):
)
assert cli._serialize(note)["items"] == [{"text": "done"}]
def test_serialize_skips_invalid_note_item_rows(monkeypatch):
make_core_db_stub(monkeypatch, models=["Note"])
cli = load_script("odysseus-notes")
note = SimpleNamespace(
id="n1",
title="Checklist",
content="",
items='[{"text": "done"}, "bad", null, 3]',
note_type="checklist",
color=None,
label=None,
pinned=False,
archived=False,
due_date=None,
source=None,
created_at=None,
updated_at=None,
)
assert cli._serialize(note)["items"] == [{"text": "done"}]