Repository navigation
fix(memories): keep local-only deletes deleted - #10862
Git-on-my-level merged 1 commit into
Conversation
Failure-Class: FC-split-mutation-authority Co-authored-by: multica-agent <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a17e549a68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if MemoryIdentity(surfacedId: memory.id).isLocalOnly { | ||
| return |
There was a problem hiding this comment.
Resolve the row's current identity before skipping DELETE
When a local memory's in-flight create finishes during the four-second undo window, MemoryStorage.markSynced can attach a real backend ID to the SQLite row while this captured ServerMemory still has its old local_<rowid> ID. This branch then skips the backend DELETE based on that stale surfaced ID, leaving the newly created server memory undeleted and able to reappear on a later refresh. Resolve the row's authoritative current identity at finalization rather than treating the UI snapshot as permanent.
AGENTS.md reference: AGENTS.md:L41-L43
Useful? React with 👍 / 👎.
| await performActualDelete(memory) | ||
| } | ||
|
|
||
| OmiMotion.withGated(.easeInOut(duration: 0.2)) { | ||
| pendingDeleteMemory = nil | ||
| undoTimeRemaining = 0 | ||
| guard self.pendingDeleteMemory?.id == memory.id else { return } |
There was a problem hiding this comment.
Disable undo once backend finalization starts
When the countdown expires or the close button starts a slow backend DELETE, this await leaves pendingDeleteMemory set, so the toast continues presenting an enabled Undo button. undoDelete() can then restore the local row but cannot cancel the already-running request; if that request succeeds, the user's apparent undo is later lost when the cache reconciles with the server. Transition out of the undoable state before starting the irreversible request, or make finalization cancellable/disable Undo while it is in flight.
AGENTS.md reference: AGENTS.md:L41-L43
Useful? React with 👍 / 👎.
Summary
local_<rowid>memory IDs to SQLite rows for delete and undo, without issuing a backend DELETE for local-only memories.Product invariants affected
Context
The reporter Firebase UID cannot be verified from this environment.
Verification
bash app/test.sh test/providers/memories_provider_deletion_test.dartapp/scripts/analyze_ratchet.shxcrun swift build -c debug --package-path DesktopMemoryLocalIdentityMutationTests.Closes #10446
Failure-Class: FC-split-mutation-authority