Notification Profiles: Normalize ids

This commit is contained in:
Scott Nonnenberg
2025-10-22 09:55:38 +10:00
committed by GitHub
parent 77d8758e2c
commit fd12f18cee
5 changed files with 27 additions and 6 deletions

View File

@@ -7281,7 +7281,7 @@
"description": "(Deleted 2025/10/15) Title text for modal where users select people or groups to include in the notification profile, who will still recevive nofications"
},
"icu:NotificationProfiles--allowed-description": {
"messageformat": "Add people and groups who you want notications from when this profile is on",
"messageformat": "Add people and groups who you want notifications from when this profile is on",
"description": "Description text for selecting people or groups that you still want to get notifications from when this profile is active"
},
"icu:NotificationProfiles--allowed-add-label": {
@@ -7453,7 +7453,7 @@
"description": "Label for pen icon next to notification profile's name on the edit page"
},
"icu:NotificationProfiles--edit--allowed": {
"messageformat": "{allowedCount, plural, zero {No allowed notifications} one {One allowed notification} other {# allowed notifications}}",
"messageformat": "Allowed notifications",
"description": "Header on notification profile edit page, showing number of contacts and groups in the allowed list"
},
"icu:NotificationProfiles--edit--schedule-timing": {

View File

@@ -1346,9 +1346,7 @@ function NotificationProfilesEditPage({
}}
preferredBadgeSelector={preferredBadgeSelector}
theme={theme}
title={i18n('icu:NotificationProfiles--edit--allowed', {
allowedCount: allowedMembersArray.length,
})}
title={i18n('icu:NotificationProfiles--edit--allowed')}
/>
<FullWidthRow className={tw('mt-8 mb-2')}>
<h2 className={tw('type-title-small')}>

View File

@@ -1924,7 +1924,7 @@ async function processRemoteRecords(
const { itemType, storageID, storageRecord } = item;
if (
itemType === ITEM_TYPE.NOTIFICATION_PROFILE ||
itemType === ITEM_TYPE.NOTIFICATION_PROFILE
itemType === ITEM_TYPE.CHAT_FOLDER
) {
recordsNeedingAllContacts.push(item);
return false;

View File

@@ -0,0 +1,21 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { LoggerType } from '../../types/Logging.std.js';
import type { WritableDB } from '../Interface.std.js';
import { sql } from '../util.std.js';
export default function updateToSchemaVersion1490(
db: WritableDB,
logger: LoggerType
): void {
const [query, params] = sql`
DELETE FROM notificationProfiles
WHERE id != lower(id);
`;
const result = db.prepare(query).run(params);
logger.info(
`Removed ${result.changes} notification profiles with non-lowercase ids`
);
}

View File

@@ -124,6 +124,7 @@ import updateToSchemaVersion1450 from './1450-all-media.std.js';
import updateToSchemaVersion1460 from './1460-attachment-duration.std.js';
import updateToSchemaVersion1470 from './1470-kyber-triple.std.js';
import updateToSchemaVersion1480 from './1480-chat-folders-remove-duplicates.std.js';
import updateToSchemaVersion1490 from './1490-lowercase-notification-profiles.std.js';
import { DataWriter } from '../Server.node.js';
@@ -1605,6 +1606,7 @@ export const SCHEMA_VERSIONS: ReadonlyArray<SchemaUpdateType> = [
{ version: 1460, update: updateToSchemaVersion1460 },
{ version: 1470, update: updateToSchemaVersion1470 },
{ version: 1480, update: updateToSchemaVersion1480 },
{ version: 1490, update: updateToSchemaVersion1490 },
];
export class DBVersionFromFutureError extends Error {