diff --git a/.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch b/.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch new file mode 100644 index 00000000..7e4adfe8 --- /dev/null +++ b/.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch @@ -0,0 +1,68 @@ +diff --git a/build/index.d.ts b/build/index.d.ts +index 880dd84215c90d7556ebca5c53f7a73050136c39..3e43fa5f05d16405e1ad6e73a66bbbe89c703b11 100644 +--- a/build/index.d.ts ++++ b/build/index.d.ts +@@ -1,5 +1,5 @@ + export { IndyVdrIndyDidRegistrar, IndyVdrIndyDidResolver, IndyVdrSovDidResolver, IndyVdrDidCreateResult, IndyVdrDidCreateOptions, } from './dids'; +-export { IndyVdrPoolConfig } from './pool'; ++export { IndyVdrPoolConfig, IndyVdrPoolService } from './pool'; + export * from './IndyVdrModule'; + export * from './IndyVdrModuleConfig'; + export * from './anoncreds'; +diff --git a/build/pool/IndyVdrPool.d.ts b/build/pool/IndyVdrPool.d.ts +index cff86a7a020c7c6152a7c08f4ce0cb4e83b3838d..ff439c23140b5a8e9d27595ecf5f813cbca7a7a1 100644 +--- a/build/pool/IndyVdrPool.d.ts ++++ b/build/pool/IndyVdrPool.d.ts +@@ -31,6 +31,7 @@ export declare class IndyVdrPool { + get indyNamespace(): string; + get config(): IndyVdrPoolConfig; + connect(): void; ++ public refreshConnection(): Promise; + private get pool(); + close(): void; + prepareWriteRequest(agentContext: AgentContext, request: Request, signingKey: Key, endorserDid?: string): Promise; +diff --git a/build/pool/IndyVdrPool.js b/build/pool/IndyVdrPool.js +index 0ec57415429a0b97844b2d65a8ee83f68ad10466..56dc4c3702a0a540fda7cf1f97c2233fc5f7546c 100644 +--- a/build/pool/IndyVdrPool.js ++++ b/build/pool/IndyVdrPool.js +@@ -25,6 +25,11 @@ class IndyVdrPool { + }, + }); + } ++ async refreshConnection() { ++ if (this._pool) { ++ await this.pool.refresh() ++ } ++ } + get pool() { + if (!this._pool) + this.connect(); +diff --git a/build/pool/IndyVdrPoolService.d.ts b/build/pool/IndyVdrPoolService.d.ts +index a21dca227076c7097bea4409233bf547eb229f11..432a2dd842076776b90b0cce08e658054fd677fe 100644 +--- a/build/pool/IndyVdrPoolService.d.ts ++++ b/build/pool/IndyVdrPoolService.d.ts +@@ -31,6 +31,7 @@ export declare class IndyVdrPoolService { + }>; + private getPoolForLegacyDid; + private getSettledDidResponsesFromPools; ++ public refreshPoolConnections(): Promise[]>; + /** + * Get the most appropriate pool for the given indyNamespace + */ +diff --git a/build/pool/IndyVdrPoolService.js b/build/pool/IndyVdrPoolService.js +index e5abc0d40cae5a4d5777220fd0c36d85496df313..3c581926d0bd31b595e498815b730263cdd5e6ef 100644 +--- a/build/pool/IndyVdrPoolService.js ++++ b/build/pool/IndyVdrPoolService.js +@@ -113,6 +113,12 @@ let IndyVdrPoolService = class IndyVdrPoolService { + successful, + }; + } ++ /** ++ * Refresh the pool connections asynchronously ++ */ ++ refreshPoolConnections() { ++ return Promise.allSettled(this.pools.map((pool) => pool.refreshConnection())) ++ } + /** + * Get the most appropriate pool for the given indyNamespace + */ diff --git a/app/src/screens/Splash.tsx b/app/src/screens/Splash.tsx index 20f49525..948dbd97 100644 --- a/app/src/screens/Splash.tsx +++ b/app/src/screens/Splash.tsx @@ -6,6 +6,7 @@ import { MediatorPickupStrategy, WsOutboundTransport, } from '@aries-framework/core' +import { IndyVdrPoolService } from '@aries-framework/indy-vdr/build/pool' import { useAgent } from '@aries-framework/react-hooks' import { agentDependencies } from '@aries-framework/react-native' import AsyncStorage from '@react-native-async-storage/async-storage' @@ -395,6 +396,8 @@ const Splash: React.FC = () => { setStep(6) await newAgent.initialize() + const poolService = newAgent.dependencyManager.resolve(IndyVdrPoolService) + await poolService.refreshPoolConnections() setStep(7) await createLinkSecretIfRequired(newAgent) diff --git a/package.json b/package.json index 399000b7..4a3fc1a8 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "@aries-framework/react-hooks@^0.4.2": "patch:@aries-framework/react-hooks@npm:0.4.2#./.yarn/patches/@aries-framework-react-hooks-npm-0.4.2-84b7eb8764.patch", "@aries-framework/react-native@0.4.0": "patch:@aries-framework/react-native@npm:0.3.3#./.yarn/patches/@aries-framework-react-native-npm-0.3.3-bb75ece22d.patch", "@aries-framework/anoncreds@^0.4.0": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch", - "@aries-framework/anoncreds@0.4.0": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch" + "@aries-framework/anoncreds@0.4.0": "patch:@aries-framework/anoncreds@npm%3A0.4.0#./.yarn/patches/@aries-framework-anoncreds-npm-0.4.0-4d3b4e769d.patch", + "@aries-framework/indy-vdr@^0.4.0": "patch:@aries-framework/indy-vdr@npm%3A0.4.0#./.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch" } } diff --git a/yarn.lock b/yarn.lock index 036a4ed8..559c2641 100644 --- a/yarn.lock +++ b/yarn.lock @@ -129,7 +129,7 @@ __metadata: languageName: node linkType: hard -"@aries-framework/indy-vdr@npm:^0.4.0": +"@aries-framework/indy-vdr@npm:0.4.0": version: 0.4.0 resolution: "@aries-framework/indy-vdr@npm:0.4.0" dependencies: @@ -141,6 +141,18 @@ __metadata: languageName: node linkType: hard +"@aries-framework/indy-vdr@patch:@aries-framework/indy-vdr@npm%3A0.4.0#./.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch::locator=bc-wallet-mobile%40workspace%3A.": + version: 0.4.0 + resolution: "@aries-framework/indy-vdr@patch:@aries-framework/indy-vdr@npm%3A0.4.0#./.yarn/patches/@aries-framework-indy-vdr-npm-0.4.0-b01067562c.patch::version=0.4.0&hash=0e7997&locator=bc-wallet-mobile%40workspace%3A." + dependencies: + "@aries-framework/anoncreds": 0.4.0 + "@aries-framework/core": 0.4.0 + peerDependencies: + "@hyperledger/indy-vdr-shared": ^0.1.0 + checksum: 71e94580f35810cb603a11af79eef2d8f49a3f8ed2c1b74ff4a66acf2e6db9f9637ac2a3d9f3ed688c73552a69f60e15cc55227c3c949aa481832940589543fa + languageName: node + linkType: hard + "@aries-framework/node@npm:0.4.0": version: 0.4.0 resolution: "@aries-framework/node@npm:0.4.0"