11import type { ReadCommitResult } from 'isomorphic-git' ;
22import type { EncryptedFS } from 'encryptedfs' ;
33import type { DB , DBTransaction , LevelPath } from '@matrixai/db' ;
4+ import type { RPCClient } from '@matrixai/rpc' ;
5+ import type { ResourceAcquire , ResourceRelease } from '@matrixai/resources' ;
46import type {
57 CommitId ,
68 CommitLog ,
@@ -15,7 +17,6 @@ import type {
1517import type KeyRing from '../keys/KeyRing' ;
1618import type { NodeId , NodeIdEncoded } from '../ids/types' ;
1719import type NodeManager from '../nodes/NodeManager' ;
18- import type { RPCClient } from '@matrixai/rpc' ;
1920import type agentClientManifest from '../nodes/agent/callers' ;
2021import type { POJO } from '../types' ;
2122import path from 'path' ;
@@ -25,12 +26,7 @@ import {
2526 CreateDestroyStartStop ,
2627 ready ,
2728} from '@matrixai/async-init/dist/CreateDestroyStartStop' ;
28- import {
29- ResourceAcquire ,
30- ResourceRelease ,
31- withF ,
32- withG ,
33- } from '@matrixai/resources' ;
29+ import { withF , withG } from '@matrixai/resources' ;
3430import { RWLockWriter } from '@matrixai/async-locks' ;
3531import * as vaultsUtils from './utils' ;
3632import * as vaultsErrors from './errors' ;
@@ -551,7 +547,7 @@ class VaultInternal {
551547 const [ release ] = await acquire ( ) ;
552548 return [
553549 async ( e ?: Error ) => {
554- release ( e ) ;
550+ await release ( e ) ;
555551 } ,
556552 this . efsVault ,
557553 ] ;
@@ -613,8 +609,8 @@ class VaultInternal {
613609 [ ...this . vaultMetadataDbPath , VaultInternal . dirtyKey ] ,
614610 false ,
615611 ) ;
616- if ( releaseTran != null ) releaseTran ( e ) ;
617- release ( e ) ;
612+ if ( releaseTran != null ) await releaseTran ( e ) ;
613+ await release ( e ) ;
618614 } ,
619615 this . efsVault ,
620616 ] ;
0 commit comments