Skip to content

armgit / kanzo

Public Imported from GitHub
0

Self-hosted, sharable kanban for humans and agents. One 4.7 MB binary, 5 MB of RAM, 10 to 60 tokens per agent reply, starts in 3 ms, zero setup.

Ignore board replies that arrive out of order

emanuele-eme8a74dcd4737
diff --git a/src/app.js b/src/app.js
index 5904c11..3d277ad 100644
--- a/src/app.js
+++ b/src/app.js
@@ -178,14 +178,21 @@ function markdown(src) {
// ---------- board ----------
+// Loads can overlap (a poll, a drop, an edit); only the newest one may render,
+// so a slow older reply never undoes what is on screen.
+let boardRequest = 0;
+
async function loadBoard() {
+ const request = ++boardRequest;
try {
const board = await api("GET", "/board?project=" + encodeURIComponent(state.project));
+ if (request !== boardRequest) return;
state.board = board;
state.changes = board.changes;
$("#offline").hidden = true;
render();
} catch (e) {
+ if (request !== boardRequest) return;
if (state.project !== "all" && /no project/.test(e.message)) {
setProject("all");
} else {