Rename files

This commit is contained in:
Fedor Indutny
2025-10-16 17:33:01 -07:00
parent 3387cf6a77
commit 44076ece79
2411 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import { type WritableDB } from '../../sql/Interface.std.js';
import {
createDB,
updateToVersion,
insertData,
getTableData,
} from './helpers.node.js';
describe('SQL/updateToSchemaVersion1310', () => {
let db: WritableDB;
afterEach(() => {
db.close();
});
beforeEach(() => {
db = createDB();
updateToVersion(db, 1300);
});
it('leaves absent muteExpiresAt untouched', () => {
const convos = [
{
id: 'convo',
expireTimerVersion: 1,
json: {},
},
];
insertData(db, 'conversations', convos);
updateToVersion(db, 1310);
assert.deepStrictEqual(getTableData(db, 'conversations'), convos);
});
it('leaves regular muteExpiresAt untouched', () => {
const convos = [
{
id: 'convo',
expireTimerVersion: 1,
json: {
muteExpiresAt: 123,
},
},
{
id: 'convo-2',
expireTimerVersion: 1,
json: {
muteExpiresAt: 8640000000000000 - 1,
},
},
];
insertData(db, 'conversations', convos);
updateToVersion(db, 1310);
assert.deepStrictEqual(getTableData(db, 'conversations'), convos);
});
it('promotes MAX_SAFE_DATE to MAX_SAFE_INTEGER', () => {
insertData(db, 'conversations', [
{
id: 'convo',
expireTimerVersion: 1,
json: {
muteExpiresAt: 8640000000000000,
},
},
]);
updateToVersion(db, 1310);
assert.deepStrictEqual(getTableData(db, 'conversations'), [
{
id: 'convo',
expireTimerVersion: 1,
json: {
muteExpiresAt: Number.MAX_SAFE_INTEGER,
},
},
]);
});
});