Skip to content

Commit d1ed9e9

Browse files
authored
fix: allow int idempotency keys (#648)
1 parent 8214dc3 commit d1ed9e9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/worker/queues/mineTransactionQueue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class MineTransactionQueue {
1616

1717
// There must be a worker to poll the result for every transaction hash,
1818
// even for the same queueId. This handles if any retried transactions succeed.
19-
static jobId = (data: MineTransactionData) => data.queueId;
19+
static jobId = (data: MineTransactionData) => `mine.${data.queueId}`;
2020

2121
static add = async (data: MineTransactionData) => {
2222
const serialized = superjson.stringify(data);

src/worker/queues/sendTransactionQueue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class SendTransactionQueue {
2121

2222
// Allow enqueing the same queueId for multiple retries.
2323
static jobId = (data: SendTransactionData) =>
24-
`${data.queueId}:${data.resendCount}`;
24+
`${data.queueId}.${data.resendCount}`;
2525

2626
static add = async (data: SendTransactionData) => {
2727
const serialized = superjson.stringify(data);

src/worker/queues/sendWebhookQueue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ export class SendWebhookQueue {
104104
const { webhook, eventLog, transactionReceipt } = args;
105105

106106
if (eventLog) {
107-
return `${webhook.url}:${eventLog.transactionHash}:${eventLog.logIndex}`;
107+
return `${webhook.url}.${eventLog.transactionHash}.${eventLog.logIndex}`;
108108
} else if (transactionReceipt) {
109-
return `${webhook.url}:${transactionReceipt.transactionHash}`;
109+
return `${webhook.url}.${transactionReceipt.transactionHash}`;
110110
}
111111
throw 'Must provide "eventLog" or "transactionReceipt".';
112112
};
@@ -139,5 +139,5 @@ export class SendWebhookQueue {
139139
webhook: Webhooks;
140140
eventType: WebhooksEventTypes;
141141
queueId: string;
142-
}) => `${args.webhook.url}:${args.eventType}:${args.queueId}`;
142+
}) => `${args.webhook.url}.${args.eventType}.${args.queueId}`;
143143
}

0 commit comments

Comments
 (0)