CKB Pulse

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)

More about Apps and UI

All 9 in this topic

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.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.