fix: handle extras messages in ExecutorService to prevent bot hang from strangers sending ahh data

This commit is contained in:
ChomeNS
2025-08-18 17:43:03 +07:00
parent 05d01d3cce
commit 3a21ada559

View File

@@ -101,7 +101,11 @@ public class ExtrasMessengerPlugin implements Listener {
final byte[] data = readByteArrayToEnd(buf);
bot.listener.dispatch(listener -> listener.onExtrasMessageReceived(uuid, data));
// you cannot trust any Extras message data because it can be
// really long and can cause the bot to hang for a while
bot.executorService.execute(
() -> bot.listener.dispatch(listener -> listener.onExtrasMessageReceived(uuid, data))
);
}
}