Skip to content

fix: surface conversation delete outcomes and clear stale rows - #25610

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/desktop-delete-feedback-1117
Nov 18, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/desktop-delete-feedback-1117

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Desktop conversation delete failures were invisible: the row/⋯ menu discarded the result and the detail page only acted on success, so a 409, a client timeout, and a successful 204 all looked like "nothing happened." The support trace for #24719 found the customer's Nov 4 conversation had already been deleted on Nov 6; his Nov 10 click was a repeat delete of an absent row.

This returns typed delete outcomes, shows shared retry feedback from both entry points, retries 409/503 with Retry-After for up to 30 seconds, treats 404 as success, and evicts local state after success. The backend now fast-paths a tombstoned, absent conversation to 204 already_deleted before gate acquisition or obligation re-arm, and marks normal/deferred outcomes with X-Omi-Delete-Outcome. Reconciliation preserves a missing in-progress row only while a matching local session is actively capturing; cache eviction failures are logged.

Fixes #24719.

Product invariants affected

  • INV-AUTH-1 — the delete transport reuses the existing authenticated request path and per-request owner validation; no auth or session behavior changes.

How it was verified

  • Focused backend wire/acceptance/gate/tombstone regressions: 98 passed.
  • Focused Swift transport, repository, reconciliation, routing, and count tests: 87 passed.
  • make preflight: 59 checks passed.
  • Async blocker scan: passed.
  • Manual named-bundle UI flow added at desktop/macos/e2e/flows/conversation-delete-feedback.yaml; not executed in this change.

Not verified here: CI, installed-app acceptance, deployed behavior.

Tests

Regression tests added for:

  • 409 then 204 with Retry-After, 404-as-success, and a hard failure that keeps the row and reports it.
  • The already-deleted backend fast path skips gate acquisition and obligation re-arm.
  • A tombstone with a remaining live row still runs cleanup.
  • Cached in-progress rows are dropped without an active local capture.

UI evidence

UI-Evidence: none -- desktop error/feedback states need a live signed build; behavior is covered by the focused Swift tests and the added e2e flow (not executed).

Failure class (fixes)

Failure-Class: FC-refused-mutation-bool-confirmed-as-success

Line-count exceptions

Line-Count-Exception: backend/routers/conversations.py | 2891 -> 2900 | the already-deleted fast path is ten lines inside the existing delete route; splitting that route now would widen this fix's review surface
Line-Count-Exception: desktop/macos/Desktop/Sources/APIClient.swift | 1474 -> 1521 | the bounded delete retry needs its request loop beside the existing delete transport; the next APIClient split can absorb it
Line-Count-Exception: desktop/macos/Desktop/Sources/DesktopAutomationBridge.swift | 5267 -> 5269 | two added lines report the typed delete outcome from the existing bridge action

View guided diff Turn on auto-fix

Keep failed deletes visible with shared shell retry feedback. Retry busy
requests within a bounded budget and clear already-absent rows locally.
Skip backend gate/obligation work for tombstoned, absent conversations.
Require matching active local capture when preserving in-progress cache rows.

Failure-Class: FC-refused-mutation-bool-confirmed-as-success
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-17T15:29:33.565479Z
We couldn’t complete this review. Comment @codex review to try again.
b37c098 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui b37c09888bfba05dd971ebc3c6358d254c7d7bfa. Each new head needs a fresh approval. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@Git-on-my-level

Copy link
Copy Markdown
Member Author

/approve-ui b37c098

@Git-on-my-level
Git-on-my-level merged commit 7df9d68 into main Nov 18, 2026
69 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/desktop-delete-feedback-1117 branch November 18, 2026 06:23
Git-on-my-level added a commit that referenced this pull request Nov 18, 2026
…elete-reminders suite

#25610 made delete_conversation read conversation_tombstones.is_deleted first;
this suite never patched it, so it reached a real Firestore client and failed
in CI (no ADC) once selected.

Failure-Class: FC-content-write-omits-implied-obligation

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Main at this merge (7df9d68) fails 8 backend unit tests that this PR's selective CI did not run. Reproduced on a clean detached checkout of 7df9d68 with the backend venv:

  • tests/unit/test_delete_conversation_cancels_task_reminders.py (6) and tests/unit/test_account_gate_busy_http.py::test_conversation_delete_route_maps_takeover_to_409: delete_conversation -> conversation_tombstones.is_deleted -> privacy_negative_cache -> real get_firestore_client (DefaultCredentialsError in the no-ADC unit sandbox). The new tombstone read needs the tests' Firestore fake/patch.
  • tests/unit/test_desktop_rest_inventory.py::test_apiclient_swift_line_count_ratchet: APIClient.swift 1521 lines > 1500.
    These now fail every PR that merges main (seen on feat(backend): host bounded jobstore retirement in serving maintenance #25630 shards 2 and 4, run 44253839905).

Git-on-my-level added a commit that referenced this pull request Nov 18, 2026
…ed webhooks for derived rows (#25661)

* fix(conversations-v3): commit live-appended sources and deliver created webhooks for derived rows

Live capture: the projection commit fenced every loaded source recording on its
exact update_time, so an owner who was still recording failed every reconcile
pass with source_changed (HTTP 500, a burned Cloud Tasks attempt) and got no
live tile or derived conversation while wearing the device. A source that only
received more speech (fence fields unchanged: deletion, merge, privacy, lock,
claims, identity) now commits the windows planned from the snapshot, merges its
claims onto the re-read document, stays v3_pending and wakes the owner at the
next minute. Derived rows and any other source change keep the strict fence.
Remaining source_changed/lease_lost races answer the task with outcome 'raced'
and a coalesced next-minute wake instead of raising (raise only if the wake
cannot be scheduled).

Webhooks: source finalization suppresses the legacy conversation-created
fanout and the derived worker never called it. A notes settle on a visible,
completed, unsuppressed derived row (or a hidden row with notes that becomes
visible) arms a durable v3_created_pending marker; the builder drain delivers
it once through trigger_external_integrations with a stable idempotency key,
require_delivery and a bounded attempt budget.

Failure-Class: FC-content-write-omits-implied-obligation

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(conversations-v3): arm created delivery on on-open notes, bound drain pages, keep private rows out

Scope-panel follow-ups: the on-open summary write arms the same single
conversation-created obligation; a saturated delivery page schedules a
continuation wake; private-level rows never arm; the final delivery attempt is
counted apart from a clean delivery; the eligibility predicate lives in the pure
v3 policy module.

Failure-Class: FC-content-write-omits-implied-obligation

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(conversations-v3): classify the created-delivery conversation reader

Failure-Class: FC-content-write-omits-implied-obligation

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(conversations-v3): import the created-delivery fanout lazily from the drain

process_conversation imports the v3 service at import time; a top-level import
of the webhook fanout pulled app_integrations and its LLM graph into that graph
and broke test_selfheal_recovery's stubbed import (CI shard 3/8).

Failure-Class: FC-content-write-omits-implied-obligation

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(conversations): stub the tombstone read added by #25610 in the delete-reminders suite

#25610 made delete_conversation read conversation_tombstones.is_deleted first;
this suite never patched it, so it reached a real Firestore client and failed
in CI (no ADC) once selected.

Failure-Class: FC-content-write-omits-implied-obligation

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(conversations-v3): recheck created-delivery eligibility on the sent payload

Panel review follow-ups: drop a claimed row that turned private/hidden/locked
before fanout, keep an unreadable payload owed instead of counting it delivered,
fail the task when a delivery wake cannot be scheduled, record fallback telemetry
on deferred Retry/on-open wakes, and pin the drain-to-delivery wiring.

Failure-Class: FC-content-write-omits-implied-obligation

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Nov 18, 2026
…nxruntime SwiftPM wrapper (#25669)

* fix(test): restore main unit tests broken by #25610

Stub the new tombstone short-circuit in the account-gate 409 delete test, and
move deleteConversation and its retry helper verbatim into
APIClient+ConversationDelete.swift so APIClient.swift is back under the
1500-line ratchet.

Failure-Class: none

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(desktop): move APIClient+ConversationDelete into Services/APIClient

Panel review-20261118t081048-8e66 F1: new Swift sources belong in a feature
directory (desktop/macos/AGENTS.md); sibling APIClient extensions already
live in Sources/Services/APIClient/. Flow coverage path updated.

Failure-Class: layout-rule
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(desktop): vendor onnxruntime-swift-package-manager after upstream 404

github.com/microsoft/onnxruntime-swift-package-manager returns "Repository
not found" since 2026-11-18, so every desktop build without a warm SwiftPM
cache fails to resolve (Desktop Swift CI on any PR that touches desktop/macos).

Vendor the wrapper at the pinned revision b7fb7f7 (1.24.2, MIT) under
desktop/macos/vendor/ and depend on it by path. The ONNX Runtime binary is
still downloaded from download.onnxruntime.ai with its upstream SHA256
checksum. Verified: cold `swift package resolve` with an empty cache,
`swift build`, and APIClientConversationDeleteTests (8 pass).

Rollback: restore the .package(url:) line, re-resolve, delete the vendor dir.

Failure-Class: external-dependency-removed
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(desktop): exempt the vendored onnxruntime wrapper from whitespace checks

Upstream files carry trailing whitespace; keep them byte-identical to the
pinned revision instead of reformatting third-party sources. Model files are
marked binary.

Failure-Class: external-dependency-removed
Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deletion fails again across mobile and desktop for conversations, recordings and memories

1 participant