Skip to content

perf(persistence): Move thread messages pagination to SQL#2750

Open
VelikovPetar wants to merge 1 commit into
v9from
backport/2688-v9
Open

perf(persistence): Move thread messages pagination to SQL#2750
VelikovPetar wants to merge 1 commit into
v9from
backport/2688-v9

Conversation

@VelikovPetar

Copy link
Copy Markdown
Contributor

Submit a pull request

Linear: FLU-487

Github Issue: #

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

Back-port of #2688 to v9. Refactors MessageDao.getThreadMessagesByParentId to filter and paginate thread replies at the SQL level instead of loading the full thread into memory, and adds support for all four PaginationParams cursor variants (lessThan / lessThanOrEqual / greaterThan / greaterThanOrEqual) with a (createdAt, id) tiebreaker.

Back-port of #2688 to v9. Refactors `MessageDao.getThreadMessagesByParentId`
to filter and paginate thread replies at the SQL level instead of loading
the full thread into memory, and adds support for all four
`PaginationParams` cursor variants (`lessThan` / `lessThanOrEqual` /
`greaterThan` / `greaterThanOrEqual`) with a `(createdAt, id)` tiebreaker.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 517abb7a-ad01-46fb-9e7b-12e5aeb38974

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backport/2688-v9

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@VelikovPetar VelikovPetar marked this pull request as ready for review June 12, 2026 18:40
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.98%. Comparing base (e19b1ce) to head (2b4b9c2).

Additional details and impacted files
@@            Coverage Diff             @@
##               v9    #2750      +/-   ##
==========================================
+ Coverage   65.96%   65.98%   +0.02%     
==========================================
  Files         425      425              
  Lines       26926    26946      +20     
==========================================
+ Hits        17761    17781      +20     
  Misses       9165     9165              

☔ 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.

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.

1 participant