Use sender+timestamp to cache receipts and read syncs
This commit is contained in:
parent
8f6fe60342
commit
0b08fc9e1f
3 changed files with 45 additions and 5 deletions
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}`;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue