Skip to content

Commit

Permalink
fix: increase zome call timeouts to 60s -- the initial zome call was …
Browse files Browse the repository at this point in the history
…still timing out at 30s because it triggers actually initializing the cell which requires compiling the wasm
  • Loading branch information
mattyg committed Oct 11, 2024
1 parent 98f900b commit f6a391a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ui/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
await adminWebsocket.authorizeSigningCredentials(cellIds[0])
}
console.log("appPort and Id is", appPort, appId)
const params: AppWebsocketConnectionOptions = {url: new URL(url)}
const params: AppWebsocketConnectionOptions = {url: new URL(url), defaultTimeout: 60000}
if (tokenResp) params.token = tokenResp.token
client = await AppWebsocket.connect(params)
let profilesClient = new ProfilesClient(client, appId);
Expand Down
20 changes: 10 additions & 10 deletions ui/src/store/RelayClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class RelayClient {
fn_name: 'create_profile',
payload: { nickname: firstName + ' ' + lastName, fields: { avatar, firstName, lastName } }
};
const profile = await this.client.callZome(req, 30000);
const profile = await this.client.callZome(req, 60000);
return profile
}

Expand All @@ -54,7 +54,7 @@ export class RelayClient {
fn_name: 'update_profile',
payload: { nickname: firstName + ' ' + lastName, fields: { avatar, firstName, lastName } }
};
const profile = await this.client.callZome(req, 30000);
const profile = await this.client.callZome(req, 60000);

// Update profile in every conversation I am a part of
Object.values(this.conversations).forEach(async (conversation) => {
Expand All @@ -64,7 +64,7 @@ export class RelayClient {
fn_name: 'update_profile',
payload: { nickname: firstName + ' ' + lastName, fields: { avatar, firstName, lastName } }
};
await this.client.callZome(req, 30000);
await this.client.callZome(req, 60000);
})

return profile
Expand Down Expand Up @@ -167,15 +167,15 @@ export class RelayClient {
fn_name: 'get_agents_with_profile',
payload: null,
};
const agentsResponse = await this.client.callZome(req, 30000);
const agentsResponse = await this.client.callZome(req, 60000);

return await agentsResponse.reduce(async (resultsPromise: { [key: AgentPubKeyB64]: Profile }, a: any) => {
const agentRecord = await this.client.callZome({
cell_id: cellId,
zome_name: 'profiles',
fn_name: 'get_agent_profile',
payload: a
}, 30000);
}, 60000);
const results = await resultsPromise;
results[encodeHashToBase64(a)] = decode(agentRecord.entry.Present.entry) as Profile
return results
Expand Down Expand Up @@ -226,7 +226,7 @@ export class RelayClient {
fn_name: 'create_profile',
payload: profile,
};
return await this.client.callZome(req, 30000);
return await this.client.callZome(req, 60000);
}

public async inviteAgentToConversation(conversationId: string, forAgent: AgentPubKey, role: number = 0): Promise<MembraneProof | undefined> {
Expand Down Expand Up @@ -256,7 +256,7 @@ export class RelayClient {
fn_name: 'get_all_contact_entries',
payload: null
}
const result = await this.client.callZome(req, 30000)
const result = await this.client.callZome(req, 60000)
return result
}

Expand All @@ -272,7 +272,7 @@ export class RelayClient {
public_key: decodeHashFromBase64(contact.publicKeyB64)
}
}
const result = await this.client.callZome(req, 30000)
const result = await this.client.callZome(req, 60000)
return result
}

Expand All @@ -292,7 +292,7 @@ export class RelayClient {
}
}
}
const result = await this.client.callZome(req, 30000)
const result = await this.client.callZome(req, 60000)
return result
}

Expand All @@ -306,6 +306,6 @@ export class RelayClient {
fn_name,
payload,
};
return await this.client.callZome(req, 30000);
return await this.client.callZome(req, 60000);
}
}

0 comments on commit f6a391a

Please sign in to comment.