You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Desktop: 'Removed by me' is structurally empty — deleteActionItemByBackendId ignores its deletedBy argument and hard-deletes #11517
The desktop "Removed by me" filter can never contain anything, and the task-extraction model is never told which tasks the user deleted, because the only code that would record user provenance passes it to a function that ignores it.
ActionItemStorage.deleteActionItemByBackendId accepts a deletedBy argument and never reads it — it hard-deletes the row (desktop/macos/Desktop/Sources/Rewind/Core/ActionItemStorage.swift:1186-1207):
/// Hard-delete an action item by backend IDfuncdeleteActionItemByBackendId(_backendId:String,deletedBy:String?=nil, // never referenced in the body
authorization:LocalMutationAuthorization)asyncthrows{...ifletrecord=trySelf.fetchRecord(database,surfacedId:backendId){tryrecord.delete(database) // hard delete, no soft-delete write
}
Its caller believes the opposite (desktop/macos/Desktop/Sources/Stores/TasksStore.swift:3179-3186):
// Local-first: soft-delete in SQLite immediately for instant UI update
tryawaitActionItemStorage.shared.deleteActionItemByBackendId(task.id,deletedBy:"user",
Both halves of that comment are wrong: the row is hard-deleted, not soft-deleted, and the provenance is discarded.
Two user-visible consequences:
"Removed by me" is structurally empty.TasksPage partitions the Removed lane on that column (desktop/macos/Desktop/Sources/MainWindow/Pages/TasksPage.swift:200-201):
Since nothing ever writes "user", every retired row has deletedBy NULL, and nil != "user" is true — so everything lands in "Removed by AI".
Task extraction never learns user deletions.TaskAssistant feeds the extraction model a "don't re-extract what the user deleted" list (desktop/macos/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistant.swift:1588):
which filters AND deletedBy = ? (ActionItemStorage.swift:1420-1432). SQL = ? never matches NULL, so this returns [] always, and the model can keep re-suggesting tasks the user explicitly removed.
Grep evidence that no writer exists: the only occurrence of "user" in a deletedBywrite position across the macOS target is the ignored argument above. Every other write is sourced from item.deletedBy (i.e. whatever the server sent), plus one explicit record.deletedBy = nil at TasksStore.swift:3363.
Found while reviewing #11460 (deleted-lane retirement), which is unrelated: that PR fixes whether retired rows reach the Removed lane at all. This is about which bucket they land in once there, and predates it.
PR #11559 fixes the single-delete path (ack keeps the tombstone + provenance; hydration stops clobbering deletedBy with the server's absent deleted_by).
Remaining gap in the same failure class, deliberately left out of that fix: bulk delete still hard-deletes. TasksStore+BulkSelection.commitLocalBulkDelete calls ActionItemStorage.deleteActionItemsByBackendIds, which record.delete(database)s every row, so Select All → Delete stays unattributed and those tasks keep landing in "Removed by AI". Fixing it needs per-id handling (local-only rows still want a hard delete, and the partial-failure path .localFailure(remoteDeletedIDs:) has to stay correct), which is why it is not folded into a verified single-path fix.
Activity
kodjima33 commentedon Aug 14, 2026
PR #11559 fixes the single-delete path (ack keeps the tombstone + provenance; hydration stops clobbering
deletedBywith the server's absentdeleted_by).Remaining gap in the same failure class, deliberately left out of that fix: bulk delete still hard-deletes.
TasksStore+BulkSelection.commitLocalBulkDeletecallsActionItemStorage.deleteActionItemsByBackendIds, whichrecord.delete(database)s every row, soSelect All → Deletestays unattributed and those tasks keep landing in "Removed by AI". Fixing it needs per-id handling (local-only rows still want a hard delete, and the partial-failure path.localFailure(remoteDeletedIDs:)has to stay correct), which is why it is not folded into a verified single-path fix.fix(desktop): keep user-deletion provenance so "Removed by me" is not…