Repository navigation
Conversation
A conversation delete hides the row at once and sends DELETE when the Undo toast closes. When that request was refused or threw, the provider restored the Siri index entry and cleared the tombstone but never put the row back, so the conversation stayed hidden until the next refresh even though the server still had it. Put the row back the same way Undo does, for the list and active search results. Fixes BasedHardware#21572 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Reviewed the delete flow end to end — this is a clean, well-scoped fix for #21572. Per file:
Aligning with the memories path ( by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Reviewed the delete flow end to end — this is a clean, well-scoped fix for #21572. Per file:
Aligning with the memories path ( by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Verified the fix end to end against the delete flow — correct, well-tested bug fix. Detail per file:
One pre-existing oddity noticed while reading (not introduced here, no action requested): _restoreSiriAfterOptimisticDelete captures generation and immediately compares it to _sessionGeneration, which is always true at that point. No changes requested. Since this touches the conversation delete/restore persistence flow, it keeps the security-review label and needs a maintainer's formal sign-off before merge. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Mobile/Flutter bug fix: restores a conversation row when the server delete fails or throws, matching existing memories-delete pattern. Fixes #21572, scoped diff (53+9), CI green (Dart Analyze & Tests pass, Backend Hermetic Merge Gate pass), new dart tests cover the failure/throw/search-active cases. Confidence 5/5.
What changed and why
Fixes #21572
Deleting a conversation hides its row at once and sends
DELETEwhen the Undo toast closes. If the server refused that request (deleteConversationServerreturnsfalsefor anything but 204 or no response) or it threw,ConversationProvideronly restored the Siri entry and cleared the tombstone. The row was never put back, so the conversation stayed hidden until the next refresh even though the server still had it.On a failed or thrown
DELETE, the provider now puts the row back the same way Undo does. Undo's restore steps moved into one helper,_restoreDeletedConversation, which both Undo and the two failure paths call: it re-adds the conversation toconversationsif it is missing, regroups (so it shows again in the list and in active search results) and restores the Siri entry. The server cursor is still left alone on failure, and a result from a previous session is still ignored.This follows what memories already do when a delete fails (
MemoriesProvider._finalizeDeletionputs the memory back). No error toast is added: the provider has no UI context, and the memories path does not show one either.Product invariants affected
none
How it was verified
deleteConversationsWithUndo→deleteConversationLocally→commitPendingDelete→deleteConversationOnServer, plus the search and detail-page entry points.dart format --line-length 120on the changed files: no changes.scripts/pr-preflight --pr-body-file <this body>: 23 checks passed.ci:fullruns the regression tests and the full app suites. I wrote the new tests to fail without the fix (the row stays out ofconversationsanddisplayedConversations) and to pass with it.Tests
app/test/providers/conversation_pending_delete_test.dart:a rejected server delete puts the row back in the listanda throws server delete puts the row back in the list: after a refused or thrownDELETE, the row is back inconversationsanddisplayedConversations, and no tombstone is left.a failed server delete puts the row back in active search results: same thing while a search is active.The existing tests for the cursor, the session fence and the Siri restore are unchanged.
UI-Evidence: none -- provider state only, no layout change; the restored row uses the existing list rendering. Covered by the provider tests above.
Failure class (fixes)
Failure-Class: FC-refused-mutation-bool-confirmed-as-success
Line-Count-Exception: app/lib/providers/conversation_provider.dart | 2119 -> 2125 | the shared restore helper's signature and doc comment; Undo's body moved into it rather than being duplicated
🤖 Generated with Claude Code