Release v2.10.3
This commit is contained in:
@@ -14,7 +14,27 @@ test('prunes old unbound onboarding devices without deleting completed bindings'
|
||||
|
||||
await pruneStaleOnboardingDevices(pool);
|
||||
|
||||
assert.match(queryText, /modified_at < \(CURRENT_TIMESTAMP - INTERVAL 1 MINUTE\)/);
|
||||
assert.match(queryText, /WHERE screen_id IS NULL/);
|
||||
assert.match(queryText, /screen_id IS NULL/);
|
||||
assert.match(queryText, /modified_at < \(CURRENT_TIMESTAMP - INTERVAL 15 MINUTE\)/);
|
||||
assert.match(queryText, /last_seen_at < \(CURRENT_TIMESTAMP - INTERVAL 24 HOUR\)/);
|
||||
assert.doesNotMatch(queryText, /d_players\.identifier = d_onboarding_devices\.device_id/);
|
||||
});
|
||||
|
||||
test('updates an onboarding device last-seen timestamp by device id', async () => {
|
||||
let queryText = '';
|
||||
let queryParams = null;
|
||||
const pool = {
|
||||
async query(sql, params) {
|
||||
queryText = sql;
|
||||
queryParams = params;
|
||||
return [[]];
|
||||
}
|
||||
};
|
||||
|
||||
const { touchOnboardingDeviceLastSeen } = require('../src/db/common');
|
||||
await touchOnboardingDeviceLastSeen(pool, ['device-123', 'client-123']);
|
||||
|
||||
assert.match(queryText, /SET last_seen_at = CURRENT_TIMESTAMP/);
|
||||
assert.match(queryText, /WHERE device_id IN \(\?, \?\)/);
|
||||
assert.deepEqual(queryParams, ['device-123', 'client-123']);
|
||||
});
|
||||
Reference in New Issue
Block a user