fix cross-thread order filtering in textSearch#257
fix cross-thread order filtering in textSearch#257ianmacartney wants to merge 3 commits intomainfrom
Conversation
commit: |
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository: get-convex/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |

Fixes a bug (#256) where
textSearchwithsearchAllMessagesForUserIdincorrectly filtered out cross-thread matches by applying the target message'sorderas a global filter. Since message order sequences are independent per thread, a target message with a low order in a new thread was causing valid matches from older threads (which naturally have higher order values) to be excluded.The fix scopes the order-based filter to same-thread messages only, both at the database query level and in the post-fetch filter. When searching across threads, the database-level
lte(order)constraint is skipped entirely, and the post-fetch filter now checksthreadIdbefore applying the order comparison. Same-thread ordering behavior is preserved — messages after the target within the same thread are still excluded.Two regression tests are added to cover both cases: cross-thread matches being returned correctly, and same-thread messages after the target still being filtered out.
Fixes #256