Skip to content

test: cover publish rollback on send failure#3406

Draft
xmtp-coder-agent wants to merge 5 commits intoxmtp:mainfrom
xmtp-coder-agent:fix/issue-3397
Draft

test: cover publish rollback on send failure#3406
xmtp-coder-agent wants to merge 5 commits intoxmtp:mainfrom
xmtp-coder-agent:fix/issue-3397

Conversation

@xmtp-coder-agent
Copy link
Copy Markdown
Contributor

@xmtp-coder-agent xmtp-coder-agent commented Apr 4, 2026

Resolves #3397

Summary

  • extract the published-intent send-failure rollback branch into a helper
  • cover the rollback path with a focused unit test using a mocked DB query
  • keep publish_intents behavior unchanged while making the regression explicit

Verification

  • nix develop --command bash -lc "cargo test -p xmtp_mls send_failures_for_published_intents_revert_to_to_publish -- --nocapture"

Note

Add test coverage for publish rollback on send failure in handle_published_intent_send_failure

  • Adds a unit test in mls_sync.rs that verifies failed published intents are reverted to to-publish state and have their attempt count incremented.
  • Extracts inline send-failure logic from sync into a new handle_published_intent_send_failure helper, which either marks the intent as errored (max attempts reached) or resets it to to-publish for retry.
  • CI workflows are updated to skip the claude-review and test-ios jobs for fork PRs that lack the required permissions.

Macroscope summarized 8aca7e1.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.03%. Comparing base (171ca8e) to head (8aca7e1).

Files with missing lines Patch % Lines
crates/xmtp_mls/src/groups/mls_sync.rs 90.24% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3406      +/-   ##
==========================================
+ Coverage   83.01%   83.03%   +0.02%     
==========================================
  Files         377      377              
  Lines       51255    51288      +33     
==========================================
+ Hits        42547    42586      +39     
+ Misses       8708     8702       -6     

☔ View full report in Codecov by Sentry.
📢 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.

# The Claude action requires the PR author to have write access to the upstream repo.
# Fork PRs run under the fork author's identity, which makes automated review fail
# during the action's permission preflight.
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is good. I don't think we need the changes below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept the fork-PR skip and reverted the extra permission/token changes below it. I also re-ran actionlint on .github/workflows/claude-code-review.yml before pushing the update.

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.

Premature Published state without rollback in publish_intents causes stranded intents

2 participants