Use sender+timestamp to cache receipts and read syncs
This commit is contained in:
16
ts/messageModifiers/generateCacheKey.ts
Normal file
16
ts/messageModifiers/generateCacheKey.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2016 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
// This function is necessary because the only thing we can guarantee will be unique is
|
||||
// three pieces of data: sender, deviceId, and timestamp.
|
||||
// Because we don't care which device interacted with our message, we collapse this down
|
||||
// to: sender + timestamp.
|
||||
export function generateCacheKey({
|
||||
sender,
|
||||
timestamp,
|
||||
}: {
|
||||
sender: string;
|
||||
timestamp: number;
|
||||
}): string {
|
||||
return `cacheKey-${sender}-${timestamp}`;
|
||||
}
|
Reference in New Issue
Block a user