Skip to content

fix(db): fix batch_read_from_cache pairwise filter broken into cross product#3802

Merged
insipx merged 1 commit into
xmtp:mainfrom
Sertug17:fix/3800-batch-read-pairwise
Jul 2, 2026
Merged

fix(db): fix batch_read_from_cache pairwise filter broken into cross product#3802
insipx merged 1 commit into
xmtp:mainfrom
Sertug17:fix/3800-batch-read-pairwise

Conversation

@Sertug17

@Sertug17 Sertug17 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Closes #3800

Replace the unzip + eq_any approach with into_boxed() + or_filter()
to ensure each (inbox_id, sequence_id) pair is matched individually
instead of producing a cross-product (inbox_id IN list) AND (sequence_id IN list).

Note

Fix batch_read_from_cache returning cross-product matches instead of exact pairs

The previous implementation filtered by inbox_id IN (...) AND sequence_id IN (...) separately, causing a cross-product of all input inbox IDs and sequence IDs to be returned instead of only the exact (inbox_id, sequence_id) pairs requested.

The fix in association_state.rs replaces the two-vector approach with iterative or_filter calls, each matching one exact (inbox_id, sequence_id) pair using a boxed query.

Macroscope summarized 8e1128c.

…product

Replace the unzip+eq_any approach with into_boxed() + or_filter()
to ensure each (inbox_id, sequence_id) pair is matched individually
instead of producing a cross-product (inbox_id IN list) AND (sequence_id IN list).

Closes xmtp#3800
@Sertug17 Sertug17 requested a review from a team as a code owner June 29, 2026 18:38
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.49%. Comparing base (7a0f50f) to head (8e1128c).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3802      +/-   ##
==========================================
- Coverage   84.54%   84.49%   -0.05%     
==========================================
  Files         410      410              
  Lines       60716    60718       +2     
==========================================
- Hits        51331    51305      -26     
- Misses       9385     9413      +28     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@insipx insipx enabled auto-merge (squash) July 2, 2026 14:37
@insipx insipx merged commit 0645b16 into xmtp:main Jul 2, 2026
41 of 42 checks passed
@insipx

insipx commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(db): batch_read_from_cache returns wrong results pairwise filter broken into cross-product

2 participants