All lessons · Apps and UI · Start here · Glossary
Saving local state after the first step of a multi-step flowWorkingFrom one fix
From one fix · Check: true, but the check found it more general than CKB · Checked 2026-11-19
In flows like Create followed by Arm, save local state right after the first transaction is sent. If you wait until the whole flow finishes, a failure in a later step leaves an on-chain object the user cannot find or cancel. Add the extra fields, such as the descriptor, once the later steps succeed.
Why it matters: If Arm fails after Create was sent, the user has an on-chain switch that does not appear in My switches and cannot be cancelled.
Pattern
remember() returned early unless the descriptor existed, so the switch was only saved after Arm. The fix calls remember() right after prepared.send() and adds the descriptor fields only when they are present.- Concepts
- Transaction building and fees, Other
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-11-16
- Last changed
- 2026-11-16
- Last checked
- 2026-11-19
- Check against the commit
- true, but the check found it more general than CKB
Sources (1)
- 2026-11-16 · psawyerberlin/dead-man-switch · more from this project
More about Apps and UI
- Nervos DAO hold time with term-locked withdrawals
- Pinning JS codecs and derivations to Rust test vectors
- Pre-sign checkers must mirror every on-chain comparison
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Saving local state after the first step of a multi-step flow", CKB lessons, https://pulse.lusocryptolabs.com/learned/apps/saving-local-state-after-the-first-step-of-a-multi-step-flow, CC BY 4.0, last changed 2026-11-16.