]> git.giacomolli.uk - onechat/commit
Keep a built leaf when the view lags the tree
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 21:53:34 +0000 (18:53 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 21:53:34 +0000 (18:53 -0300)
commitc9183f90d757006e7221ecd0d4dc0db2a25f87e0
treea49d75e0654bfea41294b6243f76b87b896ed2aa
parentcc5d2d2d302e810c6d9b862035e9f8de91941390
Keep a built leaf when the view lags the tree

A chat opens again after a crash between the build of a free leaf and
the save of the view. The catch-up adds the messages that the view does
not cover, and it now keeps a leaf that the tree holds already instead
of a second build of it, which the tree refuses as a duplicate. The
parent of such a leaf is settled at the start, with the other built
nodes.

A process that is killed during writes then opens again, so the log
loses no message that it acknowledged.

Issue: 5daf23e
memory.go
memory_test.go