Add out of order mock test for read syncs
This commit is contained in:
parent
1fef0ec208
commit
ee9de52f9d
4 changed files with 182 additions and 6 deletions
|
@ -26,10 +26,10 @@ export type ViewSyncAttributesType = {
|
|||
viewedAt: number;
|
||||
};
|
||||
|
||||
const viewSyncs = new Map<string, ViewSyncAttributesType>();
|
||||
const viewSyncs = new Map<number, ViewSyncAttributesType>();
|
||||
|
||||
function remove(sync: ViewSyncAttributesType): void {
|
||||
viewSyncs.delete(sync.envelopeId);
|
||||
viewSyncs.delete(sync.timestamp);
|
||||
sync.removeFromMessageReceiverCache();
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ export function forMessage(
|
|||
}
|
||||
|
||||
export async function onSync(sync: ViewSyncAttributesType): Promise<void> {
|
||||
viewSyncs.set(sync.envelopeId, sync);
|
||||
viewSyncs.set(sync.timestamp, sync);
|
||||
|
||||
const logId = `ViewSyncs.onSync(timestamp=${sync.timestamp})`;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue