Backend-initiated block deletion (cmd:closeonexit / wsh deleteblock) leaves a dangling layout leaf; blockclose event has no frontend subscriber
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go, typescript
Direzione di ricerca
Start with checkCloseOnExit in pkg/blockcontroller/shellcontroller.go, DeleteBlockCommand in pkg/wshrpc/wshserver/wshserver.go, and DeleteBlock in pkg/wcore/block.go to trace the backend-initiated close event. Then inspect initGlobalWaveEventSubs in frontend/app/store/global.ts and cleanupOrphanedBlocks in frontend/layout/lib/layoutModel.ts; done means reproducing the deletion leaves no dangling layout leaf, including after a restart.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
Wave 0.14.5, Windows 11, pwsh 7 shells.
Symptom
A blank column stays in the tab where a block used to be. It persists across Wave restarts. Inspecting db_layout shows a leaf whose blockId is no longer present in tab.blockids / db_block -- the block row is gone but the layout leaf is not.
Repro
- Create a widget/block with
cmd:closeonexit: true(or from inside a block runwsh deleteblock -b <id>). - Let the shell command exit with code 0.
- After
cmd:closeonexitdelay, the block row is deleted -- but the layout leaf for it remains as an empty column/leaf in the tab.
Log signature observed: a DeleteBlock: parentBlockCount: N line appears roughly 1.5s after ShellProcStatus: done, with no corresponding layout update.
Root cause (source refs, verified at tag v0.14.5)
pkg/blockcontroller/shellcontroller.goline 650,checkCloseOnExit, callswshclient.DeleteBlockCommandat line 669.pkg/wshrpc/wshserver/wshserver.goline 474,(ws *WshServer) DeleteBlockCommand, callswcore.DeleteBlock(ctx, data.BlockId, true)at line 486.pkg/wcore/block.goline 153,DeleteBlock, removes the block and (viadeleteBlockObj) emitswps.Event_BlockCloseat line 237.frontend/app/store/global.tsline 55,initGlobalWaveEventSubs, subscribes towaveobj:update,config,waveai:modeconfig,userinput,blockfile, andwaveai:ratelimit-- there is no subscription to ablockcloseevent anywhere in this function, so nothing dispatchesLayoutTreeActionType.DeleteNodewhen the backend deletes a block on its own initiative.frontend/layout/lib/layoutModel.tsline 411,cleanupOrphanedBlocks, only walkstab.blockidsand checks whether each blockId exists in the layout tree (removing the ones that don't) -- it never walks the layout tree to find leaves whoseblockIdis absent fromtab.blockids. So a leaf orphaned by a backend-initiated delete is never reconciled, even across a restart whencleanupOrphanedBlocksruns again.
Suggested fix
Either:
- Subscribe to the block-close event on the frontend (
frontend/app/store/global.ts) and dispatchLayoutTreeActionType.DeleteNodeagainst the affected tab's layout model, or - Extend
cleanupOrphanedBlocks(frontend/layout/lib/layoutModel.ts) to also prune layout leaves whoseblockIdis not present intab.blockids, not just the reverse case it currently handles.
Workaround we use
An external script that deletes dangling leaves from db_layout while Wave is closed.
Report generated with help from Claude Code.
- Lingua principale
- Go
- Stelle
- 22.3k
- Fork
- 1.1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wavetermdev/waveterm
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
wavetermdev/waveterm#3481 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
wavetermdev/waveterm#3435 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
wavetermdev/waveterm#3432 ·
-
enhancement triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
wavetermdev/waveterm#3431 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
wavetermdev/waveterm#3428 ·
Tutte le issue di wavetermdev/waveterm
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
crossplane/crossplane#7859 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bazel-contrib/rules_go#4721 · 2 commenti ·
-
needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
bug carvel-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
carvel-dev/kapp-controller#1861 ·
-
area/logging kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100