Add device inventory refresh endpoint and auto-refresh UI
Build and Deploy Gateway / build-and-push (push) Successful in 14s
Build and Deploy Gateway / deploy (push) Successful in 7s

This commit is contained in:
2026-08-07 14:00:26 +03:00
parent 36c8438b7f
commit 3157e9e8f7
8 changed files with 215 additions and 17 deletions
+9 -2
View File
@@ -30,14 +30,21 @@ test('device inventory discovers, merges, persists metadata and expires anonymou
], current.toISOString()),
error: null,
};
let observeCalls = 0;
const service = createDeviceInventoryService({
store,
observe: async () => observation,
observe: async () => {
observeCalls += 1;
return observation;
},
vendor,
now: () => current,
});
let snapshot = await service.refresh();
const [firstRefresh, sharedRefresh] = await Promise.all([service.refresh(), service.refresh()]);
let snapshot = firstRefresh;
assert.strictEqual(sharedRefresh, firstRefresh);
assert.equal(observeCalls, 1);
assert.equal(snapshot.devices.length, 1);
assert.equal(snapshot.devices[0].manufacturer, 'Example Devices');
assert.equal(snapshot.devices[0].status, 'online');