Repository navigation
Keep basesData out of TaskInfo returned by the runtime API (#2119) - #2535
Merged
Merged
Conversation
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.
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Obsidianapp, so the object is circular. The runtime API copies tasks withcopyTaskInfo, which kept the field, so these all handed it to companion plugins:tasks.get,tasks.list,query.tasks;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
copyTaskInfodropsbasesData. Every API task result and event payload already goes through it. MCP output andbuildTaskChangesalready skipped the field, so this is the same rule applied at the API boundary.data.taskinstead of forwarding the raw payload, which carried the cached task.Views keep
basesDatainternally. The cache and Bases rendering are unchanged.Tests
tests/unit/api/tasknotes-api-v1.test.ts: a cached task carrying a circularbasesData. It checks thatgetTask,listTasks,relationships.parents,updateTask,task.status.changedandpomodoro.startedpayloads are serialisable and contain nobasesData. It fails before the change.jestrun (784 suites passed),npm run lint,npm run typecheckandnpm run buildall pass. I didn't run e2e.