This is from the quickstart chat module:
spacetimedb.reducer('send_message', { text: t.string() }, (ctx, { text }) => {
// Things to consider:
// - Rate-limit messages per-user.
// - Reject messages from unnamed user.
validateMessage(text);
console.info(`User ${ctx.sender}: ${text}`);
ctx.db.message.insert({
sender: ctx.sender,
text,
sent: ctx.timestamp,
});
});
There are to issues:
The insert line throws an error: SyntaxError: Cannot convert [object Object] to a BigInt
- That error is not printed as a panic by the host in the module logs (the developer has no way to know it's happened)
This is from the quickstart chat module:
There are to issues:
The insert line throws an error:SyntaxError: Cannot convert [object Object] to a BigInt