Skip to content

feat(truapi)!: cancel a funding session in any state - #2252

Merged
filvecchiato merged 7 commits into
mainfrom
funding/single-cancel
Nov 24, 2026
Merged

filvecchiato merged 7 commits into
mainfrom
funding/single-cancel

Conversation

@filvecchiato

@filvecchiato filvecchiato commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

cancel_funding(intent) cancels a funding session in any state. The core decides what a cancel does from the session's state, so a host needs one call to stop an entry and no separate stop-starting or leave call.

State Effect Answer
Overlay up, never started stops the start on the best quote, drops present_funding (the host takes the overlay down), drops the session; watchers see Failed { Cancelled } Ended
Overlay up, provider already chosen session runs as started, provider asked to stop (once) Requested
Started, no provider ends as cancelled Ended
Provider serving it, before money moved provider asked to stop; asked again, it ends Requested, then Ended
After money moved provider asked; answers with a refusal or an offer, answered with confirm_funding_cancel Requested / Pending / TooLate
Ended or unknown nothing Refused

Closing the overlay is not a cancel. Before the session starts, the host answers present_funding with Dismissed (or calls cancel_funding, which has the same effect). After it starts, the session keeps running and the core is not told. cancel_funding_auto_start stays for going back from the quotes while the session stays open.

The RFC's Cancel section and RUNTIME.md list the table.

iOS (#2257) and Android (#2258) switch over in follow-ups: their cancel calls cancel_funding directly, without the presenting branch.

Closes #2256. Part of #2255.

@github-actions github-actions Bot added the size:M Pull requests only. 200 to 499 lines changed label Nov 23, 2026
Register the overlay before the session is held, and decide under the overlays lock whether a cancel or the overlay asks the provider.
@github-actions github-actions Bot added status:ready-to-merge Approved and waiting only to be queued and removed status:waiting-on-review Ready for a reviewer labels Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size report

Compared with main at 7a60025.

Raw Gzip Brotli
truapi-host 8.93 MiB (+3.2 KiB) 6.01 MiB (+820 B) 5.63 MiB (+3.5 KiB, +0.1%)
truapi-provider 4.17 MiB 1.32 MiB 992.3 KiB
truapi 9.29 MiB 1.31 MiB 1.06 MiB
trinity-stack 645.8 KiB 250.8 KiB 207.5 KiB
Total 23.02 MiB (+3.2 KiB) 8.88 MiB (+820 B) 7.86 MiB (+3.5 KiB)

WebAssembly modules

Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 3.80 MiB (+3.2 KiB, +0.1%) 1.31 MiB (+822 B, +0.1%) 995.6 KiB (+3.5 KiB, +0.4%)
truapi-host/wasm/web/truapi_verifiable_bg.wasm 4.89 MiB 4.64 MiB 4.61 MiB
truapi-provider/truapi_provider_bg.wasm 4.12 MiB 1.31 MiB 983.4 KiB
trinity-stack/wasm/trinity_stack_bg.wasm 574.4 KiB 233.3 KiB 192.2 KiB
Changed files (1)
Raw Gzip Brotli
truapi-host/wasm/web/truapi_server_bg.wasm 3.80 MiB (+3.2 KiB, +0.1%) 1.31 MiB (+822 B, +0.1%) 995.6 KiB (+3.5 KiB, +0.4%)

Commit: 4d475a8

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

CI Status: 26 required jobs green, 22 passed and 4 skipped by path filter.

All job results
job result
android-app success
android-bindings success
bundle-size success
changes success
changeset-guard success
cli-package success
codegen success
e2e skipped
explorer success
headless-install success
host-wasm success
install-action skipped
ios-app success
ios-bindings success
ios-lint success
licenses success
playground success
provider-android-bindings skipped
release-guard success
rust success
ts-client success
ts-debugger success
ts-host success
ts-trinity-stack success
wasm-provider success
workflow-lint skipped

Signing credentials: valid as of 2026-11-24

Commit 4d475a8e · run log

@github-actions

Copy link
Copy Markdown
Contributor

This pull request touches an app, which is not built by default. Add a label for each build you want:

  • iOS simulator build, ci:ios-simulator: builds the iOS app and attaches a build for the iOS Simulator on a Mac; its unit tests run on every pull request.
  • iOS device build, ci:ios-device: attaches a signed build that installs on a registered iPhone or iPad.

Each starts as soon as it is added and follows the branch from then on.

@filvecchiato filvecchiato changed the title feat(truapi): cancel a funding session in any state feat(truapi)!: cancel a funding session in any state Nov 24, 2026
@filvecchiato
filvecchiato added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 3080698 Nov 24, 2026
52 checks passed
@filvecchiato
filvecchiato deleted the funding/single-cancel branch November 24, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M Pull requests only. 200 to 499 lines changed status:ready-to-merge Approved and waiting only to be queued

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Funding: universal cancel in the core

2 participants