Fix RBF until events arrive#247
Conversation
Pull Request Review: Fix RBF until events arriveSummaryThis PR addresses a timing issue in RBF (Replace-By-Fee) transaction handling. The change ensures that the original transaction remains visible in the UI with a boosting status until the replacement transaction is detected via onchain events, rather than immediately marking it as removed. Code Quality and ArchitecturePositive aspects:
Changes align with AGENTS.md conventions:
Logic AnalysisBefore this PR: After this PR: Why this works:
Potential Issues and Questions1. Inconsistency with CPFP pattern This appears intentional since CPFP parent tx still exists (so it makes sense to add the child txid immediately) while RBF original tx will be replaced (and the replacement gets tracked via the event handler). However, a clarifying comment would be helpful. 2. Race condition consideration 3. ActivityItemViewModel refresh logic Performance ConsiderationsPositive:
Suggestion: The removed log was actually useful for debugging. Consider downgrading to .debug level instead of removing it entirely. Security and Bitcoin ConsiderationsSecure:
Test CoverageExisting tests:
Recommendation: Add a unit test to verify the isBoosted state transitions during RBF UI/UX ImpactUser experience improvement:
Edge case to verify: If the replacement event never arrives (network issue, node restart, etc.), the original stays in boosted state indefinitely. Is there a timeout or recovery mechanism? Recommendations
Verdict: LGTM with minor suggestionsThis is a well-targeted fix that improves UX during RBF operations. The code is clean, follows existing patterns, and addresses a real timing issue. The suggestions above are mostly nice-to-haves for clarity and testing robustness. Approve with optional follow-ups. The PR is ready to merge as-is, with the recommendations being good candidates for future improvements. |
Fix RBF until events arrive
Fix RBF until events arrive
Fix RBF until onchain events arrive
Screen.Recording.2025-11-27.at.11.18.08.AM.mov