diff options
| -rw-r--r-- | routes/payments.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/routes/payments.ts b/routes/payments.ts index 65086afd..7cdf8923 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -202,14 +202,16 @@ export default { const paymentKeys = payments.map((pid) => `payment:${pid}`); const fetched = await gfAll(paymentKeys); - const missingIds: any[] = []; const validPayments: any[] = []; for (let i = 0; i < fetched.length; i++) { const p = fetched[i]; if (!p) { + // Don't lRem the id — the underlying record may be temporarily + // unavailable (arc fallback miss, transient db issue) and we'd + // permanently lose the user's payment history pointer. Leave the + // orphan in the list so a back-fill from a backup can restore it. warn("user", id, "missing payment", payments[i]); - missingIds.push(payments[i]); continue; } if (received && p.amount < 0) continue; @@ -217,10 +219,6 @@ export default { validPayments.push(p); } - if (missingIds.length) { - for (const pid of missingIds) await db.lRem(listKey, 0, pid); - } - const internalRefs = [...new Set( validPayments .filter((p) => p.type === PaymentType.internal && p.ref) |
