Skip to content

Keep basesData out of TaskInfo returned by the runtime API (#2119) - #2535

Merged
callumalpass merged 1 commit into
mainfrom
fix/2119-api-strip-bases-data
Nov 10, 2026
Merged

callumalpass merged 1 commit into
mainfrom
fix/2119-api-strip-bases-data

Conversation

@callumalpass

Copy link
Copy Markdown
Owner

Fixes #2119. Related: callumalpass/tasknotes-workflows#22 (Workflows-side fix in callumalpass/tasknotes-workflows#23).

Cause

Credit to @konstantinopolka for the diagnosis. Bases views attach their entry to the cached TaskInfo as basesData, and that entry holds the Obsidian app, so the object is circular. The runtime API copies tasks with copyTaskInfo, which kept the field, so these all handed it to companion plugins:

  • tasks.get, tasks.list, query.tasks;
  • relationships;
  • mutation results;
  • task.* event payloads (task, before, after).

TaskNotes Workflows then overflowed the stack when evaluating expressions over the task, and then failed to write its run log ("Converting circular structure to JSON"). That second error is the notice reported here after a Kanban move.

Change

  • copyTaskInfo drops basesData. Every API task result and event payload already goes through it. MCP output and buildTaskChanges already skipped the field, so this is the same rule applied at the API boundary.
  • Pomodoro events now put the copied task in data.task instead of forwarding the raw payload, which carried the cached task.

Views keep basesData internally. The cache and Bases rendering are unchanged.

Tests

  • New case in tests/unit/api/tasknotes-api-v1.test.ts: a cached task carrying a circular basesData. It checks that getTask, listTasks, relationships.parents, updateTask, task.status.changed and pomodoro.started payloads are serialisable and contain no basesData. It fails before the change.
  • Full jest run (784 suites passed), npm run lint, npm run typecheck and npm run build all pass. I didn't run e2e.

Bases views attach their entry to the cached TaskInfo as `basesData`, and
the entry holds the Obsidian app, so the object graph is circular. The
runtime API copied tasks with copyTaskInfo, which kept the field, so
`tasks.get`, task lists, relationships, mutation results and task event
payloads all handed it to companion plugins. TaskNotes Workflows then
overflowed the stack in expressions and failed to write its run log.

Drop `basesData` in copyTaskInfo, which every API task result and event
payload already passes through, and use the copied task in the pomodoro
event `data` field instead of the raw payload. MCP output and
buildTaskChanges already skipped the field.

Root cause found by konstantinopolka. Reported by chrabia.
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.

[Bug]: Error when moving a task on the kanban board

1 participant