Repository navigation
fix(backend): isolate cloud task sync failures per item - #19460
Conversation
Failure-Class: FC-batch-fault-domain-head-of-line-poison Preserve ordered successful outcomes and attempt remaining independent exports after a per-item database or OAuth failure. Refs BasedHardware#19459.
|
Verified the fix end to end against head e0a9e20:
I also checked the sole caller ( One CI note: the Backend unit suite is red, but the two failing tests ( Thanks for the careful isolation work and the strong test suite. Automated maintainer review on David's behalf — AI-generated feedback; a human maintainer should confirm before merge. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…-isolation # Conflicts: # backend/utils/task_sync.py
|
Merged current
|
kodjima33
left a comment
There was a problem hiding this comment.
Backend bug fix (aryanorastar, trusted): isolates per-item cloud task sync failures so one failure no longer aborts the rest of the batch or mislabels earlier successes. Fixes #19459 (real filed bug). Scoped, extensively tested, CI green. Confidence 5/5 — merging.
Summary
Fixes #19459.
One failed external task export no longer aborts the rest of a conversation's cloud-sync batch or relabels earlier successful exports as failures.
Reproduction and evidence
The conversation processor saves extracted tasks, then submits
auto_sync_action_items_batch. Previously one outertrycovered every cloud export. A failure on item 1 skipped item 2 and replaced item 0's successful result, even though its external task had already been created and marked exported.The new behavioral suite executes the real batch worker and shared task-creation helper, with fault-injected database boundaries and HTTP provider stubs. On base
0e52d65c4028, 7 tests failed and 4 passed. After the fix, all 11 pass:The read/write cases also verify actual provider calls, stored export markers, one degraded telemetry event, and no raw exception content in the new log boundary.
Local HTTP verification
Ran a local Uvicorn harness on
127.0.0.1:10278, calling the real export worker / shared provider helper with synthetic database boundaries. Outbound Todoist requests were redirected to a loopback provider stub; this is not a production Todoist or full conversation API end-to-end test.[true,false,true][true,false,true][true,true,true]Every run attempted all three inputs. The write-failure case deliberately proves that the uncertain task is not automatically recreated.
Verification
backend/.venv/bin/pytest -q backend/tests/unit/test_task_sync_batch_isolation.py backend/tests/unit/test_task_sync_cloud_export_dedup.py backend/tests/unit/test_task_sync_async.py backend/tests/unit/test_task_sync_apple_async_boundary.py— 20 passed.BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-19459-tests.txt BACKEND_PYTEST_WORKERS=3 bash test.shfrombackend/— 46 passed across 11 files, including all existing task-sync/task-integration suites and universal task-authority checks.backend/scripts/typecheck.sh— 0 errors, 8,142 existing warnings.OMI_PR_BODY_FILE=/tmp/omi-19459-pr-body.md make preflight— 30 selected checks passed. Metadata validation after committing — 4 checks passed. The history-dependent 90-day failure-class recurrence check explicitly skipped on this shallow clone; full-history CI remains authoritative.git push— bounded pre-push gate passed, no bypass. Local HTTP server stopped after verification.Scope / limits
Product invariants
No mandatory invariant path citations. This preserves the existing integration and task-authority boundaries; no new integration surface or permission is introduced.
Failure-Class: FC-batch-fault-domain-head-of-line-poison