-
Notifications
You must be signed in to change notification settings - Fork 0
feat: activity boosted tx parents #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances boost transaction tracking by properly recording boost transaction IDs for both RBF (Replace-By-Fee) and CPFP (Child Pays For Parent) scenarios. The implementation ensures that parent-child transaction relationships are maintained and properly displayed in the activity detail screen.
- Added
boostTxIdsfield toPendingBoostActivitydata class - Updated boost logic to track and persist transaction IDs through the boost process
- Added UI component to display boosted transaction IDs in activity details
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
BoostTransactionViewModel.kt |
Updated CPFP and cachePendingBoostActivity logic to properly track boost transaction IDs |
ActivityDetailScreen.kt |
Added UI section to display boosted transaction IDs with appropriate labels for RBF and CPFP |
ActivityRepo.kt |
Updated pending boost activities handling to apply boostTxIds during sync |
PendingBoostActivity.kt |
Added boostTxIds field with default empty list for backward compatibility |
a96c04d to
17b44e5
Compare
PR Review: Activity Boosted TX ParentsSummaryThis PR adds tracking and display of parent transaction IDs for boosted transactions (both CPFP and RBF), aligning with iOS implementation. Overall, the implementation is solid with good documentation and careful handling of edge cases. Below are my findings across code quality, potential issues, performance, security, and test coverage. ✅ Strengths
🔴 Critical Issues1. Race Condition in BackupRepo (High Priority)Location: backupJobs[category] = scope.launch {
// Set running immediately to prevent UI showing failure during debounce
cacheStore.updateBackupStatus(category) {
it.copy(running = true)
}
delay(BACKUP_DEBOUNCE)
// Double-check if backup is still needed
val status = cacheStore.backupStatuses.first()[category] ?: BackupItemStatus()
if (status.isRequired && !isRestoring) {
triggerBackup(category)
} else {
// Backup no longer needed, reset running flag
cacheStore.updateBackupStatus(category) {
it.copy(running = false)
}
}
}Issue: Not thread-safe. Multiple calls to
Recommendation: backupJobs[category]?.cancel() // Cancel existing job
backupJobs[category] = scope.launch {
// ... rest of implementation
}2. Synchronization Issue in VssBackupClient.reset()Location: fun reset() {
synchronized(this) {
isSetup.cancel()
isSetup = CompletableDeferred()
}
vssStoreIdProvider.clearCache()
Logger.debug("VSS client reset", context = TAG)
}Issue:
Recommendation: Move 🟡 Medium Priority Issues3. Missing Null Safety CheckLocation: val currentActivity = activity?.v1
val boostTxIds = if (activityToDelete != null && currentActivity != null) {
currentActivity.boostTxIds + currentActivity.txId
} else {
emptyList()
}Issue: Recommendation: Add explicit error handling or logging when 4. Backup Order Changed Without MigrationLocation: The restore order was changed from: // Old order
SETTINGS → WALLET → ACTIVITY → METADATA → BLOCKTANKto: // New order
METADATA → SETTINGS → WALLET → ACTIVITY → BLOCKTANKIssue: METADATA is restored first to populate caches early via
Recommendation:
5. Potential Memory Leak in WalletRepoLocation: suspend fun wipeWallet(walletIndex: Int = 0): Result<Unit> = withContext(bgDispatcher) {
try {
backupRepo.reset() // Cancels all coroutines in BackupRepo
_walletState.update { WalletState() }
_balanceState.update { BalanceState() }
keychain.wipe()
// ... more cleanup
}
}Issue: Recommendation: Consider the order of operations - perhaps reset state first, then cancel observers. 🟢 Minor Issues / Suggestions6. Inconsistent Use of
|
|
Closed in favour of: |
ROADMAP: Transaction Details
This PR adds boosted txids tracking and displays parent transaction IDs in the activity details, matching iOS PR #199.
Description
boostTxIdstoPendingBoostActivityto store parent transaction IDsboostTxIdswhen boostingboostTxIds+ current txId) inPendingBoostActivity.ActivityExploreScreenPreview
QA Notes
1️⃣ RBF Test
1️⃣ CPFP Test
Same but start with RECEIVE onchain.