Skip to content

Commit 258d582

Browse files
committed
chore: code review comments
remove timeout and console logs
1 parent aa6a6a8 commit 258d582

File tree

3 files changed

+2
-32
lines changed

3 files changed

+2
-32
lines changed

packages/auth-server/composables/useAccountLogin.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ export const useAccountLogin = (_chainId: MaybeRef<SupportedChainId>) => {
3636
});
3737
return { success: true } as const;
3838
} catch (error) {
39-
// TODO: Guardian recovery not yet available in sdk-4337
40-
// Recovery fallback logic commented out
41-
// const { checkRecoveryRequest, executeRecovery, getRecovery } = useRecoveryGuardian();
42-
// ...recovery logic...
43-
4439
// eslint-disable-next-line no-console
4540
console.warn("Login failed", error);
4641
throw new Error("Account not found");

packages/auth-server/composables/useConfigurableAccount.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ export const useConfigurableAccount = () => {
1313

1414
// Get current block to calculate safe fromBlock (avoid RPC block range limits)
1515
// Add timeout to prevent hanging RPC calls (5s should be sufficient)
16-
const currentBlockPromise = publicClient.getBlockNumber();
17-
const blockTimeoutPromise = new Promise<never>((_, reject) =>
18-
setTimeout(() => reject(new Error("Timeout getting block number after 5 seconds")), 5000),
19-
);
20-
const currentBlock = await Promise.race([currentBlockPromise, blockTimeoutPromise]);
16+
const currentBlock = await publicClient.getBlockNumber();
2117

2218
// Use 100k block range to ensure we catch all events (tests pass with this value)
2319
const fromBlock = currentBlock > 100000n ? currentBlock - 100000n : 0n;
@@ -27,7 +23,7 @@ export const useConfigurableAccount = () => {
2723
// but works for now.
2824

2925
// Add timeout to event queries to prevent hanging (10s to handle multiple accounts in test environments)
30-
const eventsPromise = Promise.all([
26+
const [events, removedEvents] = await Promise.all([
3127
publicClient.getContractEvents({
3228
address: webauthnValidatorAddress,
3329
abi: WebAuthnValidatorAbi,
@@ -50,8 +46,6 @@ export const useConfigurableAccount = () => {
5046
}),
5147
]);
5248

53-
const [events, removedEvents] = await Promise.race([eventsPromise]);
54-
5549
if (!events || events.length === 0) {
5650
throw new Error("Account not found");
5751
}

packages/auth-server/pages/recovery/guardian/(actions)/confirm-recovery.vue

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,11 @@ const recoveryCompleted = computedAsync(async () => {
179179
console.log("recoveryCompleted evaluating, trigger:", _triggerValue);
180180
181181
if (!recoveryParams.value?.accountAddress || !recoveryParams.value?.credentialId || !recoveryParams.value?.credentialPublicKey) {
182-
// eslint-disable-next-line no-console
183-
console.log("recoveryCompleted: Missing params");
184182
return false;
185183
}
186184
187185
const result = await getRecovery(recoveryParams.value.accountAddress);
188186
189-
// eslint-disable-next-line no-console
190-
console.log("getRecovery result:", result);
191-
192187
// The smart contract stores keccak256(data) where data is the encoded recovery payload
193188
// We need to reconstruct the same data structure that was passed to initializeRecovery
194189
const parsedPublicKey = JSON.parse(recoveryParams.value.credentialPublicKey);
@@ -209,16 +204,8 @@ const recoveryCompleted = computedAsync(async () => {
209204
210205
const expectedHashedData = keccak256(recoveryData);
211206
212-
// eslint-disable-next-line no-console
213-
console.log("Expected hashedData:", expectedHashedData);
214-
// eslint-disable-next-line no-console
215-
console.log("Actual hashedData:", result?.hashedData);
216-
217207
const isComplete = result?.hashedData === expectedHashedData;
218208
219-
// eslint-disable-next-line no-console
220-
console.log("Recovery complete:", isComplete);
221-
222209
return isComplete;
223210
});
224211
@@ -284,9 +271,6 @@ const handleConfirmRecovery = async () => {
284271
const maxRetries = 10;
285272
const retryDelay = 1000; // 1 second between checks
286273
287-
// eslint-disable-next-line no-console
288-
console.log("Starting recovery completion polling...");
289-
290274
for (let i = 0; i < maxRetries; i++) {
291275
await new Promise((resolve) => setTimeout(resolve, retryDelay));
292276
recoveryCheckTrigger.value++;
@@ -304,9 +288,6 @@ const handleConfirmRecovery = async () => {
304288
break;
305289
}
306290
}
307-
308-
// eslint-disable-next-line no-console
309-
console.log("Finished polling. Final recoveryCompleted:", recoveryCompleted.value);
310291
} catch (err) {
311292
confirmGuardianErrorMessage.value = "An error occurred while confirming the guardian. Please try again.";
312293
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)