feat: add async SQLite on Node 24 and improve messaging diagnostics (#520)

Move database work off the main thread on Node.js 24 and improve message handling and runtime diagnostics.

Preserve migration, restart, and concurrency coverage with the async SQLite driver.
This commit is contained in:
MliKiowa authored and GitHub committed 2026-10-13 10:12:47 +08:00
1 parent 20f48d11ec
commit c7428363cb
170 files changed
+7748 -3913

No files matched your search

+13 -4
View File
@@ -65,18 +65,27 @@ describe('face animation results', () => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'snowluma-face-animation-'));
const dbPath = path.join(dir, 'messages.db');
let store = new MessageStore(dbPath);
await store.initialization;
try {
store.storeEvent(Number(event.message_id), true, 30001, 42, GROUP_MESSAGE_EVENT, event);
store.close();
await store.storeEvent(
Number(event.message_id),
true,
30001,
42,
GROUP_MESSAGE_EVENT,
event,
);
await store.close();
store = new MessageStore(dbPath);
expect(store.findEvent(Number(event.message_id))?.message).toEqual(message);
await store.initialization;
expect((await store.findEvent(Number(event.message_id)))?.message).toEqual(message);
const history = await getGroupMsgHistory(store, 30001, undefined, 20);
expect(history).toHaveLength(1);
expect(history[0].message).toEqual(message);
expect(history[0].raw_message).toBe(event.raw_message);
} finally {
store.close();
await store.close();
fs.rmSync(dir, { recursive: true, force: true });
}
});