Make transaction sending fully async so the UI only reports success after broadcast completes
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Comienza con BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift y sigue el flujo de envío a través de BuildTransactionViewModel.swift y BuildTransactionView.swift. Actualiza el flujo para que la firma y la difusión se completen antes de informar del éxito, elimina la heurística de retardo fijo y verifica que los fallos permanezcan en la pantalla de envío, mientras que las difusiones exitosas muestren el éxito posteriormente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The current send flow can report success before the transaction has actually been broadcast.
BDKClient.send is exposed as a synchronous throwing API, but the live implementation immediately starts an internal Task and returns without waiting for the async broadcast to finish. Because of that, the UI continues as if the send succeeded even though the real network operation is still in progress.
Why This Matters
This creates a user-facing correctness bug:
- The app can show a success state before the transaction is actually broadcast.
- Broadcast failures may be surfaced too late, or not in the right screen context.
- The user can be navigated away from the send screen even if the transaction was rejected.
- A wallet app should never optimistically confirm a send before the backend confirms success.
Current Behavior
BuildTransactionViewModel.send()callsbdkClient.send(...).- The live
BDKClient.sendimplementation starts a backgroundTaskand returns immediately. BuildTransactionViewModelthen postsTransactionSentright away.BuildTransactionViewwaits one second and assumes success if no error has appeared yet.
This means success is based on timing, not on the actual result of the broadcast.
Expected Behavior
The send flow should only report success after signing and broadcasting have completed successfully.
Proposed Fix
- Change the send API from synchronous to
async throwsacross the stack. - Make
BDKClient.sendawaitBDKService.send(...)directly instead of wrapping it in a detachedTask. - Update
BuildTransactionViewModel.send()to beasync. - In
BuildTransactionView, await the send call and only show the success UI after it returns successfully. - Remove the one-second timer-based success heuristic.
- Post wallet update notifications only after the async send has actually succeeded.
Suggested Acceptance Criteria
- A failed broadcast does not show the success checkmark.
- The user remains on the send screen when send fails.
- A successful broadcast shows success only after the async operation completes.
- No send-related state depends on fixed delays or race-prone background fire-and-forget tasks.
References
BDKSwiftExampleWallet/Service/BDK Service/BDKService.swiftBDKSwiftExampleWallet/View Model/Send/BuildTransactionViewModel.swiftBDKSwiftExampleWallet/View/Send/BuildTransactionView.swift
- Lenguaje dominante
- Swift
- Estrellas
- 31
- Forks
- 16
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bitcoindevkit/BDKSwiftExampleWallet
-
chore: add codeowners fileAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
bitcoindevkit/BDKSwiftExampleWallet#352 · 1 comentario ·
-
Add detailed log viewAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
bitcoindevkit/BDKSwiftExampleWallet#351 · 1 comentario ·
-
experimental: eventsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
bitcoindevkit/BDKSwiftExampleWallet#350 · 1 comentario ·
Todos los issues de bitcoindevkit/BDKSwiftExampleWallet
Issues similares
-
area/docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
apple/swift-system#400 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
rubys/roundhouse#444 ·
Los mantenedores suelen responder en 1 día
-
[BUG] `mo clean` deletes DiagnosticReports directory and breaks crash reportingPosiblemente ocupada @md786-dotcom la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día