fix(todo-sync): provide default priority to prevent SQLite NOT NULL violation
extractPriority() returns undefined when task metadata has no priority field, but OpenCode's TodoTable requires priority as NOT NULL. This causes a silent SQLiteError that prevents all Task→Todo syncing. Add ?? "medium" fallback so todos always have a valid priority.
This commit is contained in:
@@ -65,7 +65,7 @@ export function syncTaskToTodo(task: Task): TodoInfo | null {
|
||||
id: task.id,
|
||||
content: task.subject,
|
||||
status: todoStatus,
|
||||
priority: extractPriority(task.metadata),
|
||||
priority: extractPriority(task.metadata) ?? "medium",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user