Skip to content

Commit

Permalink
add idempotency test endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarco committed Jan 13, 2025
1 parent 33a12c7 commit 0db1e9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/novu-custom-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class NovuCustomHook
private generateIdempotencyKey(): string {
const timestamp = Date.now();
const randomString = Math.random().toString(36).substr(2, 9); // Generates a random alphanumeric string
return `${timestamp}-${randomString}`;
return `${timestamp}${randomString}`.trim(); // Trim any potential whitespace
}

async afterSuccess(_hookCtx: AfterSuccessContext, response: Response): Promise<Response> {
Expand Down

0 comments on commit 0db1e9e

Please sign in to comment.