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:
1 parent
20f48d11ec
commit
c7428363cb
170 files changed
+7748
-3913
No files matched your search
@@ -29,7 +29,7 @@ function device(overrides: Partial<OnlineDeviceInfo> = {}): OnlineDeviceInfo {
|
||||
}
|
||||
|
||||
describe('Bridge online-device snapshot', () => {
|
||||
it('distinguishes not-yet-observed from an observed empty snapshot', () => {
|
||||
it('distinguishes not-yet-observed from an observed empty snapshot', async () => {
|
||||
const bridge = new Bridge(IdentityService.memory('10001'));
|
||||
let current: OnlineDeviceInfo[] = [device()];
|
||||
bridge.registerCmd('test.online_devices', () => [
|
||||
@@ -43,15 +43,15 @@ describe('Bridge online-device snapshot', () => {
|
||||
|
||||
expect(bridge.getOnlineClients()).toBeNull();
|
||||
|
||||
bridge.onPacket(packet(1));
|
||||
await bridge.onPacket(packet(1));
|
||||
expect(bridge.getOnlineClients()).toEqual([device()]);
|
||||
|
||||
current = [];
|
||||
bridge.onPacket(packet(2));
|
||||
await bridge.onPacket(packet(2));
|
||||
expect(bridge.getOnlineClients()).toEqual([]);
|
||||
});
|
||||
|
||||
it('owns an immutable copy and clears it when the Bridge is disposed', () => {
|
||||
it('owns an immutable copy and clears it when the Bridge is disposed', async () => {
|
||||
const bridge = new Bridge(IdentityService.memory('10001'));
|
||||
const source = device();
|
||||
bridge.registerCmd('test.online_devices', () => [
|
||||
@@ -63,7 +63,7 @@ describe('Bridge online-device snapshot', () => {
|
||||
},
|
||||
]);
|
||||
|
||||
bridge.onPacket(packet(1));
|
||||
await bridge.onPacket(packet(1));
|
||||
const snapshot = bridge.getOnlineClients();
|
||||
expect(snapshot).not.toBeNull();
|
||||
expect(snapshot?.[0]).not.toBe(source);
|
||||
@@ -73,7 +73,7 @@ describe('Bridge online-device snapshot', () => {
|
||||
source.deviceName = 'MUTATED';
|
||||
expect(bridge.getOnlineClients()?.[0]?.deviceName).toBe('DESKTOP-TEST');
|
||||
|
||||
bridge.dispose();
|
||||
await bridge.dispose();
|
||||
expect(bridge.getOnlineClients()).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user