CKB Pulse

All lessons · CCC (TypeScript SDK) · Start here · Glossary

CCC 2.3 ccc-connector fires close before the connection eventWorkingChecked by the owner

Checked by the owner · Check: partly right · Checked 2026-11-19

CCC's ccc-connector element emits close before it announces a newly chosen wallet, every time. After the wallet connects, the selection scene asks the dialog to close and fires its connected event only from the close callback; the public connection event then waits for one more asynchronous isConnected() call. Treating close as a cancel therefore loses the connection. On close, check whether a wallet was chosen (the example reads el.walletName and el.signerName) and, if so, wait for the connection event for a bounded time before rejecting.

Why it matters: A wallet the user just connected is reported as a cancelled login and the connection is discarded.

Checked against the CCC source in @ckb-ccc/connector 2.3.2 (9ffef01) and 2.4.0 (e10b99d): scenes/selecting/index.ts (connectSigner) and connector/index.ts (close, handleConnected, updateSigner).

Pattern

Prefer
if (el.walletName && el.signerName) setTimeout(() => void finish(el.connection), 8000);

Taken from the commit, shortened.

Concepts
Login and authorization
Evidence
Checked by the owner: checked by the owner of the project it came from, who is also the publisher of these lessons
First seen
2026-10-12
Last changed
2026-10-12
Last checked
2026-11-19
Check against the commit
partly right: a true core, with a part that is loose or too wide

Sources (1)

More about CCC (TypeScript SDK)

All 33 in this topic

Checked by @LusoCryptoLabs (owner of the project), 2026-11-19.

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "CCC 2.3 ccc-connector fires close before the connection event", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/ccc-2-3-ccc-connector-fires-close-before-the-connection-even, CC BY 4.0, last changed 2026-10-12.

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.