Feat/commit loss epoch gap backfill#892
Conversation
…port history when a group stalls below its live epoch (epoch-gap backfill)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughEpoch-gap backfill detection tracks undecryptable messages by group and epoch, triggers full-history transport reactivation, and suppresses repeated signals after replay. Runtime integration drains pending backfills, while activation ordering ensures stored replay events are routed and tested. ChangesEpoch-gap backfill
Estimated code review effort: 4 (Complex) | ~60 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Ready to review this PR? Stage has broken it down into 5 individual chapters for you: Chapters generated by Stage for commit 865d5b2 on Jul 16, 2026 5:30pm UTC. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/marmot-app/src/client/sync.rs`:
- Around line 339-344: Update next_event around
epoch_stall.observe_undecryptable so arming epoch_backfill_pending causes the
method to return through its empty-result path immediately, allowing
run_pending_epoch_backfill to execute without waiting for another visible event.
Extend the existing sync tests with steady-state coverage alongside the
cold-boot case, verifying a peel-failed delivery arms backfill and reaches the
pending-backfill flow.
- Around line 351-356: Update run_pending_epoch_backfill so it checks
epoch_backfill_pending without clearing it, attempts activate_transport(None),
and only clears the pending intent after activation succeeds; preserve the early
return when no backfill is pending and do not call epoch_stall.mark_replayed
until successful activation.
In `@crates/transport-nostr-adapter/src/lib.rs`:
- Around line 534-550: Update the activation flow around state.activate and
subscribe_all so failures in subscription issuance compensate all
already-applied changes: tear down any partial subscriptions, revert the
account’s local routing state to inactive, and remove the newly recorded
telemetry before propagating the error. Ensure both zero-subscription and
partial-subscription failures leave state consistent and avoid exposing the
committed activation until subscribe_all succeeds.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f6945f79-e53c-469f-9554-0e92d73e744e
📒 Files selected for processing (8)
crates/marmot-app/src/client/epoch_stall.rscrates/marmot-app/src/client/mod.rscrates/marmot-app/src/client/sync.rscrates/marmot-app/src/lib.rscrates/marmot-app/src/runtime/account_worker.rscrates/marmot-app/tests/since_floor.rscrates/transport-nostr-adapter/src/lib.rscrates/transport-nostr-adapter/tests/inbound_routing.rs
Summary by CodeRabbit
New Features
Bug Fixes
Tests