mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Add CallLinkDeleteManager to retry and ensure deletion
This commit is contained in:
@@ -586,7 +586,7 @@ type ReadableInterface = {
|
||||
getCallLinkByRoomId: (roomId: string) => CallLinkType | undefined;
|
||||
getCallLinkRecordByRoomId: (roomId: string) => CallLinkRecord | undefined;
|
||||
getAllCallLinkRecordsWithAdminKey(): ReadonlyArray<CallLinkRecord>;
|
||||
getAllMarkedDeletedCallLinks(): ReadonlyArray<CallLinkType>;
|
||||
getAllMarkedDeletedCallLinkRoomIds(): ReadonlyArray<string>;
|
||||
getMessagesBetween: (
|
||||
conversationId: string,
|
||||
options: GetMessagesBetweenOptions
|
||||
|
||||
@@ -181,7 +181,7 @@ import {
|
||||
updateCallLinkState,
|
||||
beginDeleteAllCallLinks,
|
||||
getAllCallLinkRecordsWithAdminKey,
|
||||
getAllMarkedDeletedCallLinks,
|
||||
getAllMarkedDeletedCallLinkRoomIds,
|
||||
finalizeDeleteCallLink,
|
||||
beginDeleteCallLink,
|
||||
deleteCallLinkFromSync,
|
||||
@@ -313,7 +313,7 @@ export const DataReader: ServerReadableInterface = {
|
||||
getCallLinkByRoomId,
|
||||
getCallLinkRecordByRoomId,
|
||||
getAllCallLinkRecordsWithAdminKey,
|
||||
getAllMarkedDeletedCallLinks,
|
||||
getAllMarkedDeletedCallLinkRoomIds,
|
||||
getMessagesBetween,
|
||||
getNearbyMessageFromDeletedSet,
|
||||
getMostRecentAddressableMessages,
|
||||
|
||||
@@ -305,16 +305,13 @@ export function getAllCallLinkRecordsWithAdminKey(
|
||||
.map(item => callLinkRecordSchema.parse(item));
|
||||
}
|
||||
|
||||
export function getAllMarkedDeletedCallLinks(
|
||||
export function getAllMarkedDeletedCallLinkRoomIds(
|
||||
db: ReadableDB
|
||||
): ReadonlyArray<CallLinkType> {
|
||||
): ReadonlyArray<string> {
|
||||
const [query] = sql`
|
||||
SELECT * FROM callLinks WHERE deleted = 1;
|
||||
SELECT roomId FROM callLinks WHERE deleted = 1;
|
||||
`;
|
||||
return db
|
||||
.prepare(query)
|
||||
.all()
|
||||
.map(item => callLinkFromRecord(callLinkRecordSchema.parse(item)));
|
||||
return db.prepare(query).pluck().all();
|
||||
}
|
||||
|
||||
// TODO: Run this after uploading storage records, maybe periodically on startup
|
||||
|
||||
Reference in New Issue
Block a user