From 8fe100eebc91e62510d59f1e2c6e5a3c7b640f47 Mon Sep 17 00:00:00 2001 From: abhip2565 <74866247+abhip2565@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:40:06 +0530 Subject: [PATCH] [INJIMOB-2522] fix backup restore duplicate key in vc screen (#1735) Signed-off-by: Abhishek Paul --- shared/constants.ts | 2 ++ shared/storage.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/constants.ts b/shared/constants.ts index abf9b016b4..6cbcbf3f26 100644 --- a/shared/constants.ts +++ b/shared/constants.ts @@ -168,3 +168,5 @@ export const FACE_SDK_MODEL_CHECKSUM = '797b4d99794965749635352d55da38d4748c28c659ee1502338badee4614ed06'; export const EXPIRED_VC_ERROR_CODE = 'ERR_VC_EXPIRED'; + +export const BASE_36 = 36; diff --git a/shared/storage.ts b/shared/storage.ts index 6165f61df5..6489705a05 100644 --- a/shared/storage.ts +++ b/shared/storage.ts @@ -20,6 +20,7 @@ import { SETTINGS_STORE_KEY, ENOENT, API_CACHED_STORAGE_KEYS, + BASE_36 } from './constants'; import FileStorage, { getFilePath, @@ -346,7 +347,7 @@ class Storage { await Promise.all( allVCKeys.map(async key => { const vc = allVCs[key]; - const ts = Date.now(); + const ts = Date.now() + Math.random().toString(BASE_36).substring(2,7) const prevUnixTimeStamp = vc.vcMetadata.timestamp; const isVerified = await Storage.verifyCredential(