Closed jjj333-p closed 8 months ago
especially causes issues when the homeserver or network is lagging and therefore multiple people react to try and trigger the bot and it ends up all happening at once
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: MatrixHttpClient (REQ-23881) Error: ESOCKETTIMEDOUT
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at ClientRequest.<anonymous> (/home/joseph/spam-police/node_modules/request/request.js:816:19)
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Object.onceWrapper (node:events:631:28)
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at ClientRequest.emit (node:events:517:28)
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at TLSSocket.emitRequestTimeout (node:_http_client:847:9)
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Object.onceWrapper (node:events:631:28)
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at TLSSocket.emit (node:events:529:35)
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Socket._onTimeout (node:net:598:8)
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at listOnTimeout (node:internal/timers:569:17)
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: at process.processTimers (node:internal/timers:512:7) {
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: code: 'ESOCKETTIMEDOUT',
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: connect: false
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: }
Oct 15 17:54:45 snapshot-115842185-debian-2gb-hil-1 snap[598]: error !AGeUOyHpLMMrLYAkXW:matrix.org
Oct 15 19:55:59 snapshot-115842185-debian-2gb-hil-1 snap[598]: MatrixHttpClient (REQ-27176) { errcode: 'M_UNKNOWN', error: 'Server is unavailable' }
Oct 15 19:55:59 snapshot-115842185-debian-2gb-hil-1 snap[598]: error !YjAUNWwLVbCthyFrkz:bonifacelabs.ca
Oct 15 19:55:59 snapshot-115842185-debian-2gb-hil-1 snap[598]: MatrixHttpClient (REQ-27173) { errcode: 'M_UNKNOWN', error: 'Server is unavailable' }
Oct 15 19:55:59 snapshot-115842185-debian-2gb-hil-1 snap[598]: error !YjAUNWwLVbCthyFrkz:bonifacelabs.ca
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: MatrixHttpClient (REQ-29256) Error: ESOCKETTIMEDOUT
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at ClientRequest.<anonymous> (/home/joseph/spam-police/node_modules/request/request.js:816:19)
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Object.onceWrapper (node:events:631:28)
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at ClientRequest.emit (node:events:517:28)
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at TLSSocket.emitRequestTimeout (node:_http_client:847:9)
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Object.onceWrapper (node:events:631:28)
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at TLSSocket.emit (node:events:529:35)
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Socket._onTimeout (node:net:598:8)
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at listOnTimeout (node:internal/timers:569:17)
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at process.processTimers (node:internal/timers:512:7) {
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: code: 'ESOCKETTIMEDOUT',
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: connect: false
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: }
Oct 15 20:49:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: error !AGeUOyHpLMMrLYAkXW:matrix.org
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: MatrixHttpClient (REQ-29263) Error: ESOCKETTIMEDOUT
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at ClientRequest.<anonymous> (/home/joseph/spam-police/node_modules/request/request.js:816:19)
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Object.onceWrapper (node:events:631:28)
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at ClientRequest.emit (node:events:517:28)
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at TLSSocket.emitRequestTimeout (node:_http_client:847:9)
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Object.onceWrapper (node:events:631:28)
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at TLSSocket.emit (node:events:529:35)
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at Socket._onTimeout (node:net:598:8)
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at listOnTimeout (node:internal/timers:569:17)
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: at process.processTimers (node:internal/timers:512:7) {
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: code: 'ESOCKETTIMEDOUT',
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: connect: false
Oct 15 20:50:43 snapshot-115842185-debian-2gb-hil-1 snap[598]: }
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: MatrixHttpClient (REQ-32990) {
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: errcode: 'M_DUPLICATE_ANNOTATION',
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: error: "Can't send same reaction twice"
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: }
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: /home/joseph/spam-police/node_modules/matrix-bot-sdk/lib/http.js:95
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: throw new MatrixError_1.MatrixError(errBody, response.statusCode);
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: ^
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: MatrixError: M_DUPLICATE_ANNOTATION: Can't send same reaction twice
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: at doHttpRequest (/home/joseph/spam-police/node_modules/matrix-bot-sdk/lib/http.js:95:15)
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: at async descriptor.value (/home/joseph/spam-police/node_modules/matrix-bot-sdk/lib/metrics/decorators.js:19:32)
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: at async descriptor.value (/home/joseph/spam-police/node_modules/matrix-bot-sdk/lib/metrics/decorators.js:19:32)
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: at async descriptor.value (/home/joseph/spam-police/node_modules/matrix-bot-sdk/lib/metrics/decorators.js:19:32) {
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: body: {
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: errcode: 'M_DUPLICATE_ANNOTATION',
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: error: "Can't send same reaction twice"
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: },
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: statusCode: 400,
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: errcode: 'M_DUPLICATE_ANNOTATION',
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: error: "Can't send same reaction twice",
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: retryAfterMs: undefined
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: }
Oct 16 00:36:02 snapshot-115842185-debian-2gb-hil-1 snap[598]: Node.js v18.18.0
Oct 16 00:36:03 snapshot-115842185-debian-2gb-hil-1 systemd[1]: spam-police.service: Main process exited, code=exited, status=1/FAILURE
if the bot manages to receive multiple users confirming at once, it will banlist twice and try to react twice causing the bot to crash and restart![image](https://github.com/jjj333-p/spam-police/assets/94018608/cdfb1bd4-a17d-4097-ac1f-0b707d3d4942)