mirror of
https://github.com/aljazceru/meshcore-web.git
synced 2025-12-17 16:24:18 +01:00
mark messages as failed if they timeout
This commit is contained in:
@@ -175,8 +175,13 @@ class Connection {
|
||||
// send message
|
||||
const message = await GlobalState.connection.sendTextMessage(publicKey, text);
|
||||
|
||||
// mark message as failed after estimated timeout
|
||||
setTimeout(async () => {
|
||||
await Database.Message.setMessageFailedByAckCode(message.expectedAckCrc, "timeout");
|
||||
}, message.estTimeout);
|
||||
|
||||
// save to database
|
||||
return await Database.Message.insert({
|
||||
await Database.Message.insert({
|
||||
status: "sending",
|
||||
to: publicKey,
|
||||
from: GlobalState.selfInfo.publicKey,
|
||||
|
||||
Reference in New Issue
Block a user