Repository navigation
fix(backend): chunk conversation/sync action-item batches past Firestore's 500-op limit (#19449) - #19458
Merged
Conversation
…ore's 500-op limit delete_action_items_for_conversation, retire_action_items_for_conversation, and batch_set_sync_requested each built one Firestore WriteBatch for every matching document with no chunking, unlike the sibling delete_action_items_batch and unlock_all_action_items in the same file, which already commit every 499 ops. A conversation or sync request with more than ~500 action items would crash with "A maximum of 500 operations are allowed on a commit" instead of completing. Mirrors the existing 499-op chunking pattern already used elsewhere in this file.
Collaborator
Author
|
Backend unit shard 1/4, 2/4, and 4/4 failed in CI, but this is a pre-existing repo-wide defect unrelated to this diff, not something this PR introduced:
Merging via admin on that basis. The underlying |
kodjima33
deleted the
watchdog/issue-19449-action-items-batch-chunking
branch
September 27, 2026 16:35
kodjima33
added a commit
that referenced
this pull request
Sep 27, 2026
…c batch (#19468) Merged after confirming CI failures (Backend unit shards 1/4, 2/4, 4/4) are pre-existing, repo-wide flakes unrelated to this diff: - test_meeting_treatment.py / test_chat_first_proactive_engine.py: duration-math assertion bug (assert 1719.8 == 1720 class), already flagged separately in PR #19458. - test_mcp_client_metadata.py, test_developer_from_segments_idempotency.py: unrelated pre-existing failures. Verified these same failures occur on 5 independent recent main-branch CI runs (36341809774, 36341665838, 36340926619, 36340682730, 36339678841), none touching task_sync.py. This PR's own new test (test_batch_cloud_sync_isolates_a_failing_item_from_the_rest) passed in shard 4/4. No required status checks configured on main.
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.
Summary
batch_set_sync_requested in backend/database/action_items.py each built one Firestore
WriteBatch per call with no chunking, unlike the sibling delete_action_items_batch and
unlock_all_action_items in the same file, which already commit every 499 ops.
"A maximum of 500 operations are allowed on a commit" instead of completing.
Test plan
functions chunk writes into 499-op commits for 1200 items (499/499/202 split) and still
issue a single commit for small inputs.
(~250 tests across ~30 files) individually; all pass.
Product invariants affected
none
Failure class (fixes)
Failure-Class: none
Line-Count-Exception: backend/database/action_items.py | 1579 -> 1601 | Adds 499-op commit chunking to three write-batch helpers, mirroring the existing pattern already used by delete_action_items_batch and unlock_all_action_items in the same file; splitting the file is out of scope for this fix.