All lessons · Light client · Start here · Glossary
Light client still reports a removed script until the new script set landsWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-19
The CKB light client keeps reporting a script, with its block number, from get_scripts until you register a new script set that leaves it out. A sync poll that runs between your local delete and that set_scripts call will still see the removed script. Do not let that poll recreate local per script progress for an owner that no longer exists, and clear that progress again once the new set is registered while polling is excluded.
Why it matters: Without the guard, a poll tick in that window writes back the deleted wallet's sync progress row that the delete had just removed, leaving an orphaned row.
Pattern
if (onlyIfWalletExists && walletDao.getById(walletId) == null) returnA test changed in the same commit
It sits next to the fix. We did not run it.
- RaheemJnr/pocket-node:
android/app/src/test/java/com/rjnr/pocketnode/data/gateway/RegistrationLockTest.kt,android/app/src/test/java/com/rjnr/pocketnode/data/wallet/WalletRepositoryTest.kt,android/app/src/test/java/com/rjnr/pocketnode/ui/components/SyncSheetActionsLayoutTest.kt,android/app/src/test/java/com/rjnr/pocketnode/ui/screens/home/HomeViewModelWalletChangeTest.kt,android/app/src/test/java/com/rjnr/pocketnode/ui/screens/wallet/AddWalletViewModelCancelAddTest.kt
- Concepts
- Indexer queries and cell collection, Network and RPC reliability
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-10-11
- Last changed
- 2026-10-11
- Last checked
- 2026-11-19
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (1)
- 2026-10-11 · RaheemJnr/pocket-node · more from this project
More about Light client
- Give light clients the committing block of a cell, not just its outpoint
- Light client set_scripts "all" replaces the whole registered script set
- Light client sync progress poll racing set_scripts
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Light client still reports a removed script until the new script set lands", CKB lessons, https://pulse.lusocryptolabs.com/learned/light-client/light-client-still-reports-a-removed-script-until-the-new-sc, CC BY 4.0, last changed 2026-10-11.