Skip to content
This repository was archived by the owner on Sep 15, 2026. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: check backfill before Redis in get-logs endpoint too
Same change as status endpoint — backfill entries should take priority
over stale Redis data for consistency across all endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • Loading branch information
eabdelmoneim and claude committed Mar 24, 2026
commit fc367a5772e9f81db169b56b9dff34f3a94b0dee
21 changes: 10 additions & 11 deletions src/server/routes/transaction/blockchain/get-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,22 @@ export async function getTransactionLogs(fastify: FastifyInstance) {
// Get the transaction hash from the provided input.
let hash: Hex | undefined;
if (queueId) {
// Primary lookup
const transaction = await TransactionDB.get(queueId);
if (transaction?.status === "mined") {
hash = transaction.transactionHash;
}

// SPECIAL LOGIC FOR AMEX
// AMEX uses this endpoint to get logs for transactions they didn't receive webhooks for
// the queue ID's were cleaned out of REDIS so we backfilled tx hashes to this backfill table
// see https://github.com/thirdweb-dev/solutions-customer-scripts/blob/main/amex/scripts/load-backfill-via-api.ts
// Fallback to backfill table if enabled and not found
if (!hash && env.ENABLE_TX_BACKFILL_FALLBACK) {
// Backfill table takes priority — entries are intentional overrides for
// queue IDs that are stuck in Redis (e.g. orphaned "queued" transactions).
if (env.ENABLE_TX_BACKFILL_FALLBACK) {
const backfill = await TransactionDB.getBackfill(queueId);
if (backfill?.status === "mined" && backfill.transactionHash && isHex(backfill.transactionHash)) {
hash = backfill.transactionHash as Hex;
}
}

if (!hash) {
const transaction = await TransactionDB.get(queueId);
if (transaction?.status === "mined") {
hash = transaction.transactionHash;
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
} else if (transactionHash) {
hash = transactionHash as Hex;
}
Expand Down
Loading