Repository navigation
fix(backend): declare the conversation-scoped action-item due-range Firestore indexes (#10780) - #10786
Merged
kodjima33 merged 1 commit intoJul 28, 2026
Conversation
…ndexes GET /v1/action-items and the chat get_action_items tool accept conversation_id alongside due_start_date/due_end_date. _apply_action_item_date_filters orders that due range ascending, so those reads need composites on (conversation_id, due_at) and (completed, conversation_id, due_at). Neither was declared in the index registry nor deployed, so every conversation-scoped due-range read raised FailedPrecondition: 400 The query requires an index -- the same failure class as #10777, which only covered the (completed, due_at) chain. Declares both composites, regenerates firestore.indexes.json, and widens the due-range index contract test to every filter combination the endpoint accepts. The test now records every query get_action_items builds (the completed bucket and the bounded legacy scan each start their own) and compares equality fields as a set, because Firestore orders the equality prefix itself. Verified: - prod Firestore probe (read-only, non-existent uid) before the indexes existed: both conversation_id chains raised FailedPrecondition; completed+due range was OK - created both composites in based-hardware-dev and based-hardware; re-probed dev once READY: conversation_id+due and conversation_id+completed+due both return with no error - backend/test.sh over the index registry, manifest, reconcile and query-contract tests: 46 pass - removing the two registry entries fails the new parametrizations ([conversation], [conversation+completed]); restoring them passes Closes #10780 Failure-Class: none
Collaborator
Author
|
Watchdog verification before merge (2026-07-28):
🤖 automated by hourly watchdog — tested and merged |
kodjima33
deleted the
watchdog/issue-10780-action-items-conversation-due-index
branch
July 28, 2026 18:52
undivisible
pushed a commit
to Archit-lal/omi
that referenced
this pull request
Jul 29, 2026
…ndexes (BasedHardware#10786) GET /v1/action-items and the chat get_action_items tool accept conversation_id alongside due_start_date/due_end_date. _apply_action_item_date_filters orders that due range ascending, so those reads need composites on (conversation_id, due_at) and (completed, conversation_id, due_at). Neither was declared in the index registry nor deployed, so every conversation-scoped due-range read raised FailedPrecondition: 400 The query requires an index -- the same failure class as BasedHardware#10777, which only covered the (completed, due_at) chain. Declares both composites, regenerates firestore.indexes.json, and widens the due-range index contract test to every filter combination the endpoint accepts. The test now records every query get_action_items builds (the completed bucket and the bounded legacy scan each start their own) and compares equality fields as a set, because Firestore orders the equality prefix itself. Verified: - prod Firestore probe (read-only, non-existent uid) before the indexes existed: both conversation_id chains raised FailedPrecondition; completed+due range was OK - created both composites in based-hardware-dev and based-hardware; re-probed dev once READY: conversation_id+due and conversation_id+completed+due both return with no error - backend/test.sh over the index registry, manifest, reconcile and query-contract tests: 46 pass - removing the two registry entries fails the new parametrizations ([conversation], [conversation+completed]); restoring them passes Closes BasedHardware#10780 Failure-Class: none
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
GET /v1/action-itemsand the chatget_action_itemstool acceptconversation_idalongside
due_start_date/due_end_date. Every such read 500'd withFailedPrecondition: 400 The query requires an index. Issue #10780.Root cause
_apply_action_item_date_filtersorders a due range ascending, andget_action_itemsadds
conversation_id ==(and, for the completed bucket,completed ==) on top. Thatneeds two composites —
(conversation_id ASC, due_at ASC)and(completed ASC, conversation_id ASC, due_at ASC)— neither declared inbackend/database/firestore_index_registry.pynor deployed. #10777/#10778 declared onlythe
(completed ASC, due_at ASC)chain, so the conversation-scoped reads kept failing.Fix
firestore.indexes.json.test_action_items_due_range_index_contract.pyto every filter combination theendpoint accepts. The recorder now captures every query
get_action_itemsbuilds (thecompleted bucket and the bounded legacy scan each start their own from
db.collection('users')), and equality fields are compared as a set because Firestoreorders the equality prefix itself.
based-hardware-devandbased-hardware,so the deploy-time reconcile check-only gate stays green.
Verified
conversation_id + due rangeandconversation_id + completed + due rangeboth raisedFailedPrecondition;completed + due rangewas OK (control).based-hardware-devonce READY: bothconversation_id chains return with no error.
backend/test.shover the index registry, manifest, reconcile and query-contract tests:46 pass.
[conversation]and[conversation+completed]; restoring them passes.Closes #10780
Failure-Class: none
🤖 automated by hourly watchdog — tested and merged