add a lot more logging to both client and server to analyze #81

> #81 Compiling brush doesn't seem to finish correctly sometimes, which causes loss of data
> Sometimes it seems like the client state can get desynced (server render thread dies due to a panic?) and then the server starts dropping all requests for drawing the brush.
> These panics should never happen of course, but we need better logging first to determine the exact cause.
This commit is contained in:
りき萌 2024-09-02 20:14:20 +02:00
parent 6cfbc4f05f
commit 26d3b8ed8a
5 changed files with 86 additions and 11 deletions

View file

@ -74,6 +74,14 @@ impl Ast {
ast
}
pub fn len(&self) -> usize {
self.kinds.len()
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
pub fn alloc(&mut self, kind: NodeKind, span: Span) -> Result<NodeId, NodeAllocError> {
if self.kinds.len() >= self.kinds.capacity() {
return Err(NodeAllocError);