Skip to content

Commit

Permalink
fix: call compose retry a single time after onboard completes (#2968)
Browse files Browse the repository at this point in the history
* fix: call compose retry a single time after onboard completes

* chore: try catch so it doesn't affect one click flow
  • Loading branch information
tim-schultz authored Oct 11, 2024
1 parent f72b51b commit 5ad3893
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions app/hooks/useOneClickVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ export const useOneClickVerification = () => {
.filter((patch): patch is StampPatch => patch !== null);

await handlePatchStamps(stampPatches);

try {
datadogLogs.logger.info(`Attempting to retry writing stamps to compose db ${address}`);
// Attempt to retry writing stamps to compose db that have failed to write at some point in the past
handleComposeRetry();
} catch (error) {
console.error("Error when attempting to retry writing stamps to compose db", error);
datadogLogs.logger.error("Error when attempting to retry writing stamps to compose db", {
error: String(error),
});
}
setUserVerificationState({
...verificationState,
loading: false,
Expand All @@ -99,11 +110,5 @@ export const useOneClickVerification = () => {
return verificationState.error || verificationState.success;
}, [verificationState.error, verificationState.success]);

useEffect(() => {
if (verificationComplete) {
handleComposeRetry();
}
}, [handleComposeRetry, verificationComplete]);

return { initiateVerification, verificationState, verificationComplete };
};

0 comments on commit 5ad3893

Please sign in to comment.