Skip to content

chore(send): collaborative send#1245

Open
theborakompanioni wants to merge 8 commits into
develfrom
tbk/collaborative-send
Open

chore(send): collaborative send#1245
theborakompanioni wants to merge 8 commits into
develfrom
tbk/collaborative-send

Conversation

@theborakompanioni
Copy link
Copy Markdown
Collaborator

@theborakompanioni theborakompanioni commented May 9, 2026

Enhance the collaborative send flow to improve reliability and UX by saving the last payment attempt, better error reporting, and minor refactors.
Tries to mitigate missing infos on failed attempts: joinmarket-clientserver does not provide good info about errors or other failures.
Flow:

  • store payment attempt + utxos hash in session storage
  • wait till taker operation ends
  • if utxos hash changed, show a success message
  • if utxos has did not change, show an error message with payment attempt details

Note:

  • if a user did not start the taker operation in this session, no info can be shown and collaborative send flow just ends without any information at all - this is not good UX, but we cannot really do anything about it.

@theborakompanioni theborakompanioni self-assigned this May 9, 2026
@theborakompanioni theborakompanioni added the enhancement New feature or request label May 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 76.1% (🎯 70%) 1137 / 1494
🔵 Statements 76.03% (🎯 70%) 1253 / 1648
🔵 Functions 66.53% (🎯 60%) 348 / 523
🔵 Branches 69.1% (🎯 60%) 783 / 1133
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/send/PaymentAbortDialog.tsx 66.66% 100% 33.33% 66.66% 33-36
src/i18n/locales/en/translation.json 100% 100% 100% 100%
Generated in workflow #3122 for commit 1568f41 by the Vitest Coverage Report Action

@theborakompanioni theborakompanioni added the WIP Work in Progress label May 9, 2026
@theborakompanioni theborakompanioni force-pushed the tbk/collaborative-send branch from 1b5094b to 94aa24b Compare May 9, 2026 21:33
@theborakompanioni theborakompanioni marked this pull request as ready for review May 10, 2026 21:41
@theborakompanioni theborakompanioni removed the WIP Work in Progress label May 10, 2026
Comment thread src/context/JamSessionInfoContext.ts
const isWaitingCoinjoinStart = startCoinjoinMutationIsPending || (startCoinjoinMutationIsSuccess && !coinjoinRunning)
const isWaitingCoinjoinStop = stopCoinjoinMutationIsPending || (stopCoinjoinMutationIsSuccess && coinjoinRunning)
const collaborativeFlowActive = coinjoinRunning || isWaitingCoinjoinStart || isWaitingCoinjoinStop
const isWaitingCoinjoinStart = startCoinjoinMutationIsPending || (startCoinjoinMutationIsSuccess && !takerRunning)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

edge case: if /docoinjoin succeeds but coinjoin_in_process never flips true, or flips too quickly before the session poll sees it, this can stay in “Starting collaborative transaction...” forever.

Maybe we should add a timeout/reset fallback here, or allow the stored attempt to move into the completion/ended state after some time.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good observation. While that is certainly true, it complicates the code and might create even more problems. I will revisit and see what can be done. Maybe address in a follow-up.

@theborakompanioni theborakompanioni force-pushed the tbk/collaborative-send branch from 354cbc3 to 1568f41 Compare May 11, 2026 19:59
</Alert>
) : (
<Alert variant="success">
<AlertTriangleIcon />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

smoll UI nit: this is the success branch, but it still uses AlertTriangleIcon. Maybe CheckCircle2Icon would make the completed state feel less like a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants