Skip to content

Fix incorrect swap index in bubble-down loop in select_messages_to_republish#7090

Open
sudo-shashank wants to merge 2 commits into
mainfrom
shashank/fix-incorrect-swap-index
Open

Fix incorrect swap index in bubble-down loop in select_messages_to_republish#7090
sudo-shashank wants to merge 2 commits into
mainfrom
shashank/fix-incorrect-swap-index

Conversation

@sudo-shashank
Copy link
Copy Markdown
Contributor

@sudo-shashank sudo-shashank commented May 21, 2026

Summary of changes

Changes introduced in this pull request:

  • Fix the incorrect swap index and add test to verify.

Reference issue to close (if applicable)

Closes #7075

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Refactor

    • Improved message chain ordering logic during republish operations.
  • Tests

    • Added unit tests for message chain reordering functionality.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 21, 2026

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR directly addresses issue #7075 by extracting the bubble-down logic into a helper method and fixing the swap index from (i, i+1) to (j, j+1).
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the bubble-down swap bug and adding necessary tests; no unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title clearly and specifically describes the main bug fix: correcting an incorrect swap index in the bubble-down loop within select_messages_to_republish, which is the primary change throughout the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shashank/fix-incorrect-swap-index
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch shashank/fix-incorrect-swap-index

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

@sudo-shashank sudo-shashank marked this pull request as ready for review May 21, 2026 13:49
@sudo-shashank sudo-shashank requested a review from a team as a code owner May 21, 2026 13:49
@sudo-shashank sudo-shashank requested review from LesnyRumcajs and akaladarshi and removed request for a team May 21, 2026 13:49
@sudo-shashank sudo-shashank marked this pull request as draft May 21, 2026 13:49
@sudo-shashank sudo-shashank marked this pull request as ready for review May 21, 2026 13:51
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.25%. Comparing base (3b7dcd7) to head (f46bf3a).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/message_pool/msg_chain.rs 88.88% 1 Missing ⚠️
src/message_pool/msgpool/republish.rs 95.23% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/message_pool/msg_chain.rs 84.79% <88.88%> (+0.09%) ⬆️
src/message_pool/msgpool/republish.rs 87.09% <95.23%> (+4.11%) ⬆️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b7dcd7...f46bf3a. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sudo-shashank sudo-shashank changed the title Fix: incorrect swap index in bubble-down loop in select_messages_to_republish Fix incorrect swap index in bubble-down loop in select_messages_to_republish May 22, 2026
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: incorrect swap index in bubble-down loop in select_messages_to_republish

1 participant