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

@@ -17,7 +17,7 @@ import { sendGroupMessage, videoNeedsFileFallback } from '../src/modules/message
const MB = 1024 * 1024;
function fakeBridge(overrides: Partial<BridgeInterface> = {}): BridgeInterface {
return new Proxy(overrides as BridgeInterface, {
return new Proxy({ identity: { nickname: 'SnowLuma' }, ...overrides } as BridgeInterface, {
get(target, prop) {
if (prop in target) {
return (target as any)[prop];
@@ -31,10 +31,22 @@ function fakeBridge(overrides: Partial<BridgeInterface> = {}): BridgeInterface {
function makeCtx(bridge: BridgeInterface): OneBotInstanceContext {
return {
uin: '10001',
selfId: 10001,
bridge,
messageStore: { findEvent: () => null, resolveReplySequence: () => 0 } as any,
messageStore: {
findEvent: () => null,
resolveReplySequence: () => 0,
storeEvent: vi.fn(),
} as any,
cacheMessageMeta: vi.fn(),
mediaStore: {} as any,
converterCtx: {
selfId: 10001,
imageUrlResolver: null,
mediaUrlResolver: null,
messageIdResolver: null,
mediaSegmentSink: null,
},
musicSignUrl: '',
} as unknown as OneBotInstanceContext;
}
@@ -51,10 +63,7 @@ describe('send_group_msg large-video fallback', () => {
_name: string,
_folder: string,
_doUpload: boolean,
) => ({
fileId: 'auto-fid',
fileHash: null,
}),
) => ({ fileId: 'auto-fid', fileHash: null }),
);
const publish = vi.fn();
const bridge = fakeBridge({