Skip to content

Memories out of sync across phone vs desktop; deleted memories reappear #10446

Closed

Description

@omi-discord-vector

Summary

A user reports two related memories issues:

  1. The phone app shows no memories while the desktop app shows 15+ memories.
  2. Deleting some memories appears to work, but those memories reappear after ~10–15 seconds.

User-reported environment

  • Same account/email on phone and desktop
  • All apps updated to the latest stable version

Repro / observations

  1. Open desktop app → Memories page shows 15+ memories.
  2. Open phone app on the same account → Memories page shows 0 memories.
  3. Attempt to delete specific memories.
  4. The memories disappear briefly, then reappear after ~10–15 seconds.

Expected

  • Phone and desktop should show the same synced memories for the same account.
  • Deleted memories should stay deleted.

Actual

  • Desktop and phone memory lists are inconsistent.
  • Some deletes do not persist and are undone by a later refresh/sync.

Notes / likely area

This may be a sync/local-cache vs backend consistency issue:

  • desktop may be showing locally cached memories that were never fully synced, while phone only shows backend-synced memories
  • or delete requests are failing / not persisting, then auto-refresh restores the memory from backend or local cache

Relevant client code paths worth checking:

  • mobile memories provider + delete flow
  • desktop local-first memory cache / sync / auto-refresh behavior
  • backend DELETE /v3/memories/:id persistence path

Support context

Reported in Discord help thread: "Two issues - Memories" on July 23, 2026.

Activity

  1. aryanorastar commented on Jul 24, 2026

    @aryanorastar
    Collaborator

    Root-caused symptom 2 ("deleted memories reappear after ~10–15s") to a read/write decision asymmetry in the V3 memory rollout — not a client cache issue.

    The two decisions are gated on different rollout modes. MemoryRolloutMode is off | shadow | write | read (backend/config/memory_rollout.py), and:

    • canonical_write_decision (utils/memory/canonical_activation.py) enables canonical writes when mode ∈ {write, read} — if rollout_config.mode not in {MemoryRolloutMode.write, MemoryRolloutMode.read}: … not writable
    • canonical_read_enabled (same module) returns False unless mode == read — if rollout_config.mode != MemoryRolloutMode.read: return False

    The delete route follows the write decision; the list route follows the read decision:

    • DELETE /v3/memories/{memory_id} (backend/routers/memories.py:837) branches on _canonical_write_enabled_or_fail_closed(...) → MemoryService(...).delete(...), which tombstones the canonical item.
    • GET /v3/memories (backend/routers/memories.py:~640) branches on canonical_read_enabled(...).

    So while MEMORY_MODE=write — the dual-write stage a rollout necessarily passes through before read cutover, and #10394 has this rollout mid-flight — a delete tombstones the canonical record while the user's list keeps reading legacy, where the row is untouched. The client drops it optimistically, the next refresh re-reads legacy, and it comes back. That matches the reported ~10–15s reappearance exactly.

    This may also explain symptom 1 (desktop 15+, phone 0): in write mode new memories land in canonical only, so any surface still reading legacy shows an emptier list than one reading canonical. Worth confirming which read path each client uses before treating that half as the same bug.

    What I did not do: propose the code change. The fix is a rollout-semantics call, not a mechanical one — during dual-write, either the delete must apply to both stores (symmetric with dual-write), or it must target the store the user actually reads. Picking wrong on a user-data deletion path during a live migration is the kind of thing that should be decided by whoever owns the rollout contract, and I can't see prod's current MEMORY_MODE from here. Happy to implement whichever semantic you want, with tests.

    Quick confirmation for whoever picks this up: check prod MEMORY_MODE. If it's write, this is deterministic for every affected account, not a flake.

  2. aryanorastar commented on Jul 24, 2026

    @aryanorastar
    Collaborator

    Implemented the server-side half in #10451.

    It mirrors the canonical delete into legacy while MEMORY_MODE=write, so a delete lands in the store the user actually reads. The mirror no-ops after read cutover, is best-effort (canonical is authoritative and already committed — a legacy cleanup failure must not fail a request the user saw succeed), and no-ops for canonical-only rows since Firestore deletes of absent documents do nothing.

    One thing genuinely needs your call, not mine: I picked symmetric dual-delete (a delete applies to both stores while both are live). The alternative is routing deletes at the store the user reads. Both are defensible; this is a live migration's deletion path, so the rollout owner should pick. Easy to switch.

    DELETE /v3/memories (delete-all) has the same asymmetry but I deliberately left it out — mirroring it means a bulk wipe of the legacy collection, a far larger blast radius than this bug, and it should land with explicit sign-off.

    Regression test verified against the old code (fails) and the fix (passes); INV-MEM-1 guard green; preflight 19/19.

    Worth checking when you triage: if prod is at MEMORY_MODE=write, this is deterministic for every affected account rather than an intermittent glitch. Symptom 1 (desktop 15+ vs phone 0) is plausibly the same split — new memories land in canonical while a surface still reading legacy looks empty — but I'd confirm which read path each client uses before assuming.

  3. kodjima33 commented on Jul 25, 2026

    @kodjima33
    Collaborator

    Triage note on the root cause above — the write/read asymmetry cannot be what prod users are hitting, so #10451 (merged as 5fa372e) does not change prod behavior and the reported symptoms are still unexplained.

    Verified against the live prod service (gcloud run services describe backend --region us-central1 --project based-hardware):

    • MEMORY_MODE=off
    • MEMORY_ENABLED_USERS unset
    • MEMORY_V3_GET_ENABLED=false

    With MEMORY_MODE=off, MemoryRolloutConfig.for_user() returns _legacy_capabilities for every uid, and resolve_memory_system() short-circuits to MemorySystem.LEGACY before the code cohort matters (backend/utils/memory/memory_system.py:41). build_v3_production_runtime() also returns enabled=False on the MEMORY_V3_GET_ENABLED=false gate. So on prod both the read and the delete follow legacy — there is no canonical/legacy split to desynchronise. (based-hardware-dev is at MEMORY_MODE=read, i.e. past the write stage, so the asymmetry isn't live there either.)

    Two consequences for whoever picks this up:

    1. The deferred DELETE /v3/memories (delete-all) mirror is latent, not a live prod bug — no reason to rush a bulk legacy delete into prod on the strength of this report.
    2. Both reported symptoms need a different explanation on the legacy path. Both clients call the same routes (app/lib/backend/http/api/memories.dart and desktop/.../APIClient+Memories.swift both use v3/memories), so an endpoint split isn't it either. Worth getting from the reporter: the affected uid, whether the phone is on a dev/staging build (different Firebase project ⇒ genuinely different account), and app/desktop versions — then check that uid's legacy Firestore rows directly rather than reasoning from the rollout config.

    Posted by the hourly desktop bug watchdog; read-only verification, no code change.

  4. moved this from Someday to In progress in omi TODO / bountieson Jul 29, 2026
  5. added a commit that references this issue on Jul 29, 2026
    80fe201
  6. moved this from In progress to In review in omi TODO / bountieson Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions