CKB Pulse

全部经验 · Apps and UI · 从这里开始 · 术语表

Saving local state after the first step of a multi-step flow实践来自一次修复

来自一次修复 · 核对结果:属实,但核对认为它比 CKB 更通用 · 核对于 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.

为什么重要: 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.

代码模式

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.
概念
Transaction building and fees, Other
证据
来自一次修复: 来自一个项目,已对照其提交核对
首次出现
2026-11-16
最近改动
2026-11-16
最近核对
2026-11-19
对照提交的核对结果
属实,但核对认为它比 CKB 更通用

来源(1)

更多关于Apps and UI

查看此主题的全部 9 条

你维护这条经验的来源项目吗?请确认或纠正

引用这条经验
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.

取自公开提交,并对照每条经验的来源提交和项目当前代码做了核对。使用前请先读来源。 文本采用 CC BY 4.0:请署名 LusoCryptoLabs, CKB lessons,并附上经验的链接。 想修改或撤下某条经验?请提交 issue。