From 8353125836431e3e689dd7a1ae1a80259e647827 Mon Sep 17 00:00:00 2001 From: Hoseong Lee Date: Mon, 4 May 2026 09:41:25 -0500 Subject: [PATCH 1/2] minor change uid -> folderUid in the DKdFolderAccesst type --- keeperapi/src/syncDown/types.ts | 2 +- keeperapi/src/vault.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keeperapi/src/syncDown/types.ts b/keeperapi/src/syncDown/types.ts index 4e8cfe7..00fc7ca 100644 --- a/keeperapi/src/syncDown/types.ts +++ b/keeperapi/src/syncDown/types.ts @@ -19,7 +19,7 @@ export type DKdFolder = { export type DKdFolderAccess = { kind: 'keeper_drive_folder_access' accessUid: string - uid: string + folderUid: string accessTypeUid: string accessType: Folder.AccessType accessRoleType: Folder.AccessRoleType diff --git a/keeperapi/src/vault.ts b/keeperapi/src/vault.ts index f0394fc..8434ab6 100644 --- a/keeperapi/src/vault.ts +++ b/keeperapi/src/vault.ts @@ -1192,7 +1192,7 @@ const processKdFolderAccesses = async ( await storage.put({ kind: 'keeper_drive_folder_access', accessUid: createKdFolderAccessCompositeKey(accessTypeUid, folderUid), - uid: folderUid, + folderUid, accessTypeUid, accessType: folderAccess.accessType, accessRoleType: folderAccess.accessRoleType, From 99d4766aa321c882bcb05ea932ab1cda3e3c8cbb Mon Sep 17 00:00:00 2001 From: Hoseong Lee Date: Wed, 6 May 2026 13:41:07 -0500 Subject: [PATCH 2/2] A removed dependency can now explicitly specify parentKind and childKind --- keeperapi/src/vault.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/keeperapi/src/vault.ts b/keeperapi/src/vault.ts index 8434ab6..f20aba3 100644 --- a/keeperapi/src/vault.ts +++ b/keeperapi/src/vault.ts @@ -266,9 +266,14 @@ export type Dependency = { parentUid: string uid: string } +export type RemovedDependency = { + parentKind: VaultStorageKind + childKind: VaultStorageKind + childUid: string +} export type DependencyMap = Record export type Dependencies = Record> -export type RemovedDependencies = Record | '*'> +export type RemovedDependencies = Record | '*'> const addDependencies = (dependencies: Dependencies, parentUid: string, childUid: string, kind: VaultStorageKind) => { let children = dependencies[parentUid] @@ -283,13 +288,17 @@ const addDependencies = (dependencies: Dependencies, parentUid: string, childUid }) } -const addRemovedDependencies = (dependencies: RemovedDependencies, parentUid: string, childUid: string) => { +const addRemovedDependencies = ( + dependencies: RemovedDependencies, + parentUid: string, + childUid: string | RemovedDependency +) => { let children = dependencies[parentUid] if (children === '*') { return } if (!children) { - children = new Set() + children = new Set() dependencies[parentUid] = children } children.add(childUid) @@ -1401,7 +1410,11 @@ const processKdRemovedFolderRecords = ( if (!folderRecord.recordUid || !folderRecord.folderUid) continue const recordUid = webSafe64FromBytes(folderRecord.recordUid) const folderUid = webSafe64FromBytes(folderRecord.folderUid) - addRemovedDependencies(removedDependencies, folderUid, recordUid) + addRemovedDependencies(removedDependencies, folderUid, { + parentKind: 'keeper_drive_folder', + childKind: 'record', + childUid: recordUid, + }) } }