Stop round-tripping wallpaper data

This commit is contained in:
trevor-signal
2025-07-17 11:20:00 -04:00
committed by GitHub
parent e6a57f69d8
commit f471b75a5f
5 changed files with 201 additions and 12 deletions

View File

@@ -0,0 +1,41 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { LoggerType } from '../../types/Logging';
import { type WritableDB } from '../Interface';
export const version = 1410;
export function updateToSchemaVersion1410(
currentVersion: number,
db: WritableDB,
logger: LoggerType
): void {
if (currentVersion >= 1410) {
return;
}
db.transaction(() => {
db.exec(`
UPDATE conversations
SET json = json_remove(json,
'$.wallpaperPreset',
'$.wallpaperPhotoPointerBase64',
'$.dimWallpaperInDarkMode',
'$.autoBubbleColor'
);
DELETE FROM items
WHERE id IN (
'defaultWallpaperPhotoPointer',
'defaultWallpaperPreset',
'defaultDimWallpaperInDarkMode',
'defaultAutoBubbleColor'
);
`);
db.pragma('user_version = 1410');
})();
logger.info('updateToSchemaVersion1410: success!');
}

View File

@@ -115,10 +115,11 @@ import { updateToSchemaVersion1360 } from './1360-attachments';
import { updateToSchemaVersion1370 } from './1370-message-attachment-indexes';
import { updateToSchemaVersion1380 } from './1380-donation-receipts';
import { updateToSchemaVersion1390 } from './1390-attachment-download-keys';
import { updateToSchemaVersion1400 } from './1400-simplify-receipts';
import {
updateToSchemaVersion1400,
updateToSchemaVersion1410,
version as MAX_VERSION,
} from './1400-simplify-receipts';
} from './1410-remove-wallpaper';
import { DataWriter } from '../Server';
@@ -2113,6 +2114,7 @@ export const SCHEMA_VERSIONS = [
updateToSchemaVersion1390,
updateToSchemaVersion1400,
updateToSchemaVersion1410,
];
export class DBVersionFromFutureError extends Error {