nit: can you add an early error + return in case node.dataset.threadId is falsy?