CKB Pulse

Todas as lições · Apps and UI · Começa aqui · Glossário

Saving local state after the first step of a multi-step flowPráticoDe uma correção

De uma correção · Verificação: verdadeira, mas a verificação achou-a mais geral do que a CKB · Verificada em 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.

Porque importa: 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.

Padrão

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.
Conceitos
Transaction building and fees, Other
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-11-16
Última mudança
2026-11-16
Última verificação
2026-11-19
Verificação contra o commit
verdadeira, mas a verificação achou-a mais geral do que a CKB

Fontes (1)

Mais sobre Apps and UI

Ver as 9 deste tema

Manténs um projeto de onde esta lição veio? Confirma ou corrige

Citar esta lição
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.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.