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

@@ -295,7 +295,7 @@ export const ELEMENT_CODECS = {
const eventName = ctx.isGroup
? GROUP_MESSAGE_EVENT
: privateMessageEventName(sentBySelf, false);
const id = resolveReplyId(
const id = await resolveReplyId(
ctx.isGroup,
ctx.sessionId,
element.replySeq ?? 0,
@@ -328,10 +328,10 @@ export const ELEMENT_CODECS = {
return null;
}
const meta = options?.resolveReplyMeta?.(id) ?? null;
const meta = (await options?.resolveReplyMeta?.(id)) ?? null;
if (options?.resolveReplySequence) {
const resolved = options.resolveReplySequence(id);
const resolved = await options.resolveReplySequence(id);
if (typeof resolved === 'number' && resolved > 0) {
const element: MessageElement = {
@@ -400,7 +400,7 @@ export const ELEMENT_CODECS = {
}
if (ctx.mediaSegmentSink) {
ctx.mediaSegmentSink('image', element, data, ctx.isGroup, ctx.sessionId);
await ctx.mediaSegmentSink('image', element, data, ctx.isGroup, ctx.sessionId);
}
return { type: 'image', data };
@@ -437,7 +437,7 @@ export const ELEMENT_CODECS = {
};
if (ctx.mediaSegmentSink) {
ctx.mediaSegmentSink('record', element, data, ctx.isGroup, ctx.sessionId);
await ctx.mediaSegmentSink('record', element, data, ctx.isGroup, ctx.sessionId);
}
return { type: 'record', data };
@@ -468,7 +468,7 @@ export const ELEMENT_CODECS = {
};
if (ctx.mediaSegmentSink) {
ctx.mediaSegmentSink('video', element, data, ctx.isGroup, ctx.sessionId);
await ctx.mediaSegmentSink('video', element, data, ctx.isGroup, ctx.sessionId);
}
return { type: 'video', data };