Better handle group call ring race conditions

This commit is contained in:
Evan Hahn 2022-11-16 20:52:04 -06:00 committed by GitHub
parent 629b5c3f6a
commit a88243f26d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 169 additions and 116 deletions

View file

@ -2390,4 +2390,36 @@ describe('SQL migrations test', () => {
);
});
});
describe('updateToSchemaVersion69', () => {
beforeEach(() => {
updateToVersion(69);
});
it('removes the legacy groupCallRings table', () => {
const tableCount = db
.prepare(
`
SELECT COUNT(*) FROM sqlite_schema
WHERE type = "table"
AND name = "groupCallRings"
`
)
.pluck();
assert.strictEqual(tableCount.get(), 0);
});
it('adds the groupCallRingCancellations table', () => {
assert.doesNotThrow(() => {
db.exec(
`
INSERT INTO groupCallRingCancellations
(ringId, createdAt)
VALUES (1, 2);
`
);
});
});
});
});