Skip to content

Commit e5318d8

Browse files
committed
fix: add http prefix
1 parent 64130e7 commit e5318d8

File tree

6 files changed

+34
-41
lines changed

6 files changed

+34
-41
lines changed
-15.6 MB
Binary file not shown.
-1.53 KB
Binary file not shown.
-1.44 KB
Binary file not shown.

infrastructure/eid-wallet/src-tauri/gen/android/app/arm64/release/output-metadata.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

infrastructure/web3-adapter/src/evault/evault.ts

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const CONFIG = {
1919
CONNECTION_POOL_SIZE: 10,
2020
HEALTH_CHECK_TIMEOUT: 5000, // 5 seconds for health check
2121
MAX_HEALTH_CHECK_FAILURES: 3, // Max consecutive failures before re-resolution
22+
GRAPHQL_TIMEOUT: 10000, // 10 seconds for GraphQL requests before considering endpoint unhealthy
2223
} as const;
2324

2425
const STORE_META_ENVELOPE = `
@@ -389,6 +390,35 @@ export class EVaultClient {
389390
console.log(`Removed cached client for ${w3id}`);
390391
}
391392

393+
/**
394+
* Wrapper for GraphQL requests with timeout handling
395+
*/
396+
private async withTimeout<T>(
397+
w3id: string,
398+
operation: () => Promise<T>
399+
): Promise<T> {
400+
const controller = new AbortController();
401+
const timeoutId = setTimeout(() => {
402+
controller.abort();
403+
console.log(`GraphQL request timeout for ${w3id}, marking endpoint as unhealthy`);
404+
this.removeCachedClient(w3id);
405+
}, CONFIG.GRAPHQL_TIMEOUT);
406+
407+
try {
408+
const result = await operation();
409+
clearTimeout(timeoutId);
410+
return result;
411+
} catch (error) {
412+
clearTimeout(timeoutId);
413+
414+
if (error instanceof Error && error.name === 'AbortError') {
415+
throw new Error(`Request timeout after ${CONFIG.GRAPHQL_TIMEOUT}ms`);
416+
}
417+
418+
throw error;
419+
}
420+
}
421+
392422
/**
393423
* Manually trigger a health check for a specific w3id
394424
* Useful for testing or forcing re-resolution
@@ -466,15 +496,15 @@ export class EVaultClient {
466496
console.log("sending to eVault: ", envelope.w3id)
467497
console.log("sending payload", envelope);
468498

469-
const response = await client
470-
.request<StoreMetaEnvelopeResponse>(STORE_META_ENVELOPE, {
499+
const response = await this.withTimeout(envelope.w3id, () =>
500+
client.request<StoreMetaEnvelopeResponse>(STORE_META_ENVELOPE, {
471501
input: {
472502
ontology: envelope.schemaId,
473503
payload: envelope.data,
474504
acl: ["*"],
475505
},
476506
})
477-
.catch(() => null);
507+
).catch(() => null);
478508

479509
if (!response) return v4();
480510
return response.storeMetaEnvelope.metaEnvelope.id;

platforms/registry/src/services/UriResolutionService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class UriResolutionService {
4242
return originalUri;
4343
}
4444

45-
const newUri = `${workingIp}:${port}`;
45+
const newUri = `http://${workingIp}:${port}`;
4646
console.log(`Substituted ${originalUri} with ${newUri} using working IP from Kubernetes`);
4747

4848
return newUri;

0 commit comments

Comments
 (0)