Ignore delivery receipts for outgoing reactions

This commit is contained in:
Fedor Indutny 2023-12-19 15:57:15 +01:00 committed by GitHub
parent c8099171e2
commit e46b1f7958
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 151 additions and 34 deletions

View file

@ -0,0 +1,32 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { Database } from '@signalapp/better-sqlite3';
import type { LoggerType } from '../../types/Logging';
export const version = 980;
export function updateToSchemaVersion980(
currentVersion: number,
db: Database,
logger: LoggerType
): void {
if (currentVersion >= 980) {
return;
}
db.transaction(() => {
db.exec(`
ALTER TABLE reactions ADD COLUMN timestamp NUMBER;
CREATE INDEX reactions_byTimestamp
ON reactions
(fromId, timestamp);
`);
})();
db.pragma('user_version = 980');
logger.info('updateToSchemaVersion980: success!');
}

View file

@ -72,10 +72,11 @@ import { updateToSchemaVersion930 } from './930-fts5-secure-delete';
import { updateToSchemaVersion940 } from './940-fts5-revert';
import { updateToSchemaVersion950 } from './950-fts5-secure-delete';
import { updateToSchemaVersion960 } from './960-untag-pni';
import { updateToSchemaVersion970 } from './970-fts5-optimize';
import {
version as MAX_VERSION,
updateToSchemaVersion970,
} from './970-fts5-optimize';
updateToSchemaVersion980,
} from './980-reaction-timestamp';
function updateToSchemaVersion1(
currentVersion: number,
@ -2015,6 +2016,7 @@ export const SCHEMA_VERSIONS = [
updateToSchemaVersion950,
updateToSchemaVersion960,
updateToSchemaVersion970,
updateToSchemaVersion980,
];
export class DBVersionFromFutureError extends Error {