Repository navigation
fix(backend): isolate per-item failures in cloud action-item auto-sync batch (#19459) - #19468
Merged
Merged
Conversation
…c batch auto_sync_action_items_batch wrapped its whole cloud-sync loop in one try/except. A transient failure on one item (e.g. an OAuth preflight error in create_task_internal) aborted every remaining item and overwrote earlier successful results with a blanket error for the entire batch. Wrap each item's sync call individually so one failure no longer erases already-succeeded exports or skips items after it. Shared-configuration failures (no default integration, integration not found/connected) still short-circuit the whole batch as before.
kodjima33
deleted the
watchdog/issue-19459-task-sync-batch-isolation
branch
September 27, 2026 19:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
auto_sync_action_items_batch(backend/utils/task_sync.py) wraps its entire cloud-exportloop in one
try/except. A transient failure syncing a single action item — e.g. an OAuthpreflight error raised inside
create_task_internalforgoogle_tasks/asana— aborts theloop immediately. The
exceptthen returns[{"synced": False, "error": ...}] * len(action_items),which:
Filed as #19459.
Root cause
The per-item
forloop over cloud services has no per-item error boundary; one raisedexception propagates out of the whole batch.
Fix
Wrap each item's
_sync_to_cloud_servicecall in its owntry/exceptinside the loop, so asingle item's failure produces only that item's error result. The outer
try/exceptstillcovers the shared-configuration lookups before the loop (
get_default_task_integration,get_task_integration,connectedcheck), so a genuinely shared failure still short-circuitsthe whole batch, as the issue's "Expected" section asks for.
Tested
test_batch_cloud_sync_isolates_a_failing_item_from_the_resttobackend/tests/unit/test_task_sync_cloud_export_dedup.py: three items, the middle one'screate_task_internalraises; asserts items 0 and 2 still sync successfully and only item 1reports an error.
test_task_sync_cloud_export_dedup.py,test_task_sync_async.py,test_task_sync_apple_async_boundary.py, andtest_process_conversation_usage_context.pysuites — all pass (10 + 55 tests).
Diff: 10 insertions/3 deletions in
task_sync.py, +38 lines of test.Failure-Class: none
🤖 automated by hourly watchdog — tested and merged