Skip to content

Commit

Permalink
Cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Feb 6, 2025
1 parent bf44c48 commit 4f7d9d4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/paidAction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export async function retryPaidAction (actionType, args, incomingContext) {
return await models.$transaction(async tx => {
const context = { ...retryContext, tx, invoiceArgs }

// update the old invoice to RETRYING, so that it's not confused with FAILED
await tx.invoice.update({
where: {
id: failedInvoice.id,
Expand Down
1 change: 1 addition & 0 deletions api/resolvers/paidAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default {
}

const result = await retryPaidAction(invoice.actionType, { invoice }, { paymentAttempt, models, me, lnd })

return {
...result,
type: paidActionType(invoice.actionType)
Expand Down
1 change: 0 additions & 1 deletion api/resolvers/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ const resolvers = {
if (!me) {
throw new GqlAuthenticationError()
}
// make sure each invoice is only returned once via visibility timeouts and SKIP LOCKED
return await models.$queryRaw`
SELECT * FROM "Invoice"
WHERE "userId" = ${me.id}
Expand Down
1 change: 1 addition & 0 deletions wallets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ function RetryHandler ({ children }) {
if (!stopped) queuePoll()
}, NORMAL_POLL_INTERVAL)
}

const stopPolling = () => {
stopped = true
clearTimeout(timeout)
Expand Down
4 changes: 2 additions & 2 deletions wallets/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export async function createWrappedInvoice (userId,

export async function getInvoiceableWallets (userId, { paymentAttempt, predecessorId, models }) {
// filter out all wallets that have already been tried by recursively following the retry chain of predecessor invoices.
// the current predecessor invoice is in state 'FAILED' and not in state 'RETRYING'
// because we are currently retrying it so it has not been updated yet.
// the current predecessor invoice is in state 'FAILED' and not in state 'RETRYING' because we are currently retrying it
// so it has not been updated yet.
// if predecessorId is not provided, the subquery will be empty and thus no wallets are filtered out.
const wallets = await models.$queryRaw`
SELECT
Expand Down

0 comments on commit 4f7d9d4

Please sign in to comment.