You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bounty Proposal] fix(staged_tasks): filter completed entities in creation dedup and default relevance_score for index sorting ($50 proposed) #21875
backend/database/staged_tasks.py contains two subtle lifecycle and query defects that prevent users from creating new staged tasks when a historic task shared the same normalized description, and silently drop newly created staged tasks from get_staged_tasks queries in Firestore:
Stale Completed Staged Task Dedup Deadlock (create_staged_task):
create_staged_task loops over col.stream() and deduplicates by normalized description without checking doc.get('completed').
When a user previously completed, promoted, or dismissed a staged task with that description, create_staged_task returns the stale completed document instead of creating a fresh candidate.
The returned document has completed=True, making it invisible to get_staged_tasks(uid) (which filters where('completed', '==', False)) and permanently blocking subsequent promotions via promote_staged_task (if staged.get('completed'): return None).
Missing relevance_score Dropping Staged Tasks from Firestore Queries:
create_staged_task only sets relevance_score if explicitly passed in kwargs.
In Firestore, queries with order_by('relevance_score') silently omit any document that lacks the sorted field.
Consequently, staged tasks created without an explicit relevance_score are never returned by get_staged_tasks or selected by get_top_staged_task_for_promotion.
Solution
In create_staged_task, filter out completed staged tasks during the deduplication loop (if data.get('completed'): continue) so deduplication only matches against active candidates.
Default relevance_score to 0 when omitted, ensuring every stored staged task is immediately sortable and indexable by Firestore query planners.
Added comprehensive unit tests in backend/tests/unit/test_staged_tasks_dedup.py covering both behaviors (18/18 tests pass).
@josancamon19 I see #21876 is open for this issue. Is there still a separate paid assignment for the complete #21875 fix, or is the work already covered?
I read the current staged_tasks.py: creation can reuse completed matches, and rows without relevance_score are excluded from ordered reads. I would preserve active-task dedup, cover fresh creation and both list/top-promotion queries, and include the full regression coverage.
If the work is available, could you confirm the target revision and full acceptance, approved fixed amount/currency (the title says $50 proposed), and a payout route for a mainland-China individual, including fees and timing? Then I can agree the complete scope and delivery time before starting.
Activity
ayqy commentedon Oct 17, 2026
@josancamon19 I see #21876 is open for this issue. Is there still a separate paid assignment for the complete #21875 fix, or is the work already covered?
I read the current staged_tasks.py: creation can reuse completed matches, and rows without relevance_score are excluded from ordered reads. I would preserve active-task dedup, cover fresh creation and both list/top-promotion queries, and include the full regression coverage.
If the work is available, could you confirm the target revision and full acceptance, approved fixed amount/currency (the title says $50 proposed), and a payout route for a mainland-China individual, including fees and timing? Then I can agree the complete scope and delivery time before starting.
undivisible commentedon Oct 22, 2026
Thanks for putting this together. We aren't doing bounties at the moment, so we're closing the bounty proposal issues for now — thanks for the fix! 🙏
fix(staged_tasks): filter completed entities in creation dedup and de…