From 98e3fb4520a84686286dcf2c8ec71a60b6c76deb Mon Sep 17 00:00:00 2001 From: shum Date: Thu, 22 Oct 2026 16:34:16 +0000 Subject: [PATCH] store: say how late money is credited or alerted --- apps/simplex-store-service/src/StoreService/Orders.hs | 2 +- apps/simplex-store-service/src/StoreService/Poller.hs | 2 +- tests/Bots/StoreService/NamesLateCreditTests.hs | 2 +- tests/Bots/StoreService/NamesOrdersTests.hs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/simplex-store-service/src/StoreService/Orders.hs b/apps/simplex-store-service/src/StoreService/Orders.hs index fbb3928280..9b38468d58 100644 --- a/apps/simplex-store-service/src/StoreService/Orders.hs +++ b/apps/simplex-store-service/src/StoreService/Orders.hs @@ -225,7 +225,7 @@ lateSupportOf = \case latePayment :: InvoiceId -> RegistrationId -> IO () latePayment (InvoiceId invText) (RegistrationId rid) = - logInfo ("names: invoice " <> invText <> " received money after registration " <> rid <> " closed; it stays unpaid, and its confirmed money is credited to its balance") + logInfo ("names: invoice " <> invText <> " received money after registration " <> rid <> " closed; it stays unpaid, and its money is credited to its balance once confirmed, else alerted") holdNotSpent :: InvoiceId -> RegistrationId -> RegistrationId -> IO () holdNotSpent (InvoiceId invText) (RegistrationId holder) (RegistrationId source) = diff --git a/apps/simplex-store-service/src/StoreService/Poller.hs b/apps/simplex-store-service/src/StoreService/Poller.hs index 35d8fae683..a3ec50e1eb 100644 --- a/apps/simplex-store-service/src/StoreService/Poller.hs +++ b/apps/simplex-store-service/src/StoreService/Poller.hs @@ -417,7 +417,7 @@ lateReason env@PollerEnv {peStore, peProviders} LateAlert {laPending, laState = where unconfirmed = "refund by hand only a transaction confirmed on chain that BTCPay no longer monitors; one still Processing there waits" highSpeed = "the invoice was made under HighSpeed, so its money is never credited by itself; refund by hand only a transaction confirmed on chain" - noConfirmation = "the Monero plugin shows no confirmation of this money (the invoice's settled-confirmation threshold is 0 or not given), so it is never credited by itself; refund by hand only a transaction confirmed on chain" + noConfirmation = "the Monero plugin shows no confirmation of this money, so it is never credited by itself; refund by hand only a transaction confirmed on chain" rateRead = "confirmed, the credit waits on the rate read; do not refund; fix the rate read" cardWaits = "confirmed, the credit waits on the poller's credit pass; do not refund; check the service log" rateFloor current = "confirmed; the coin's price fell by more than half since the invoice (" <> fromMaybe "?" lsInvoiceRate <> ", " <> current <> "); it is never credited by itself; refund by hand only a transaction confirmed on chain" diff --git a/tests/Bots/StoreService/NamesLateCreditTests.hs b/tests/Bots/StoreService/NamesLateCreditTests.hs index 3150176450..ddf21edf76 100644 --- a/tests/Bots/StoreService/NamesLateCreditTests.hs +++ b/tests/Bots/StoreService/NamesLateCreditTests.hs @@ -569,7 +569,7 @@ testXmrLate = withLate $ \l@Late {lStore = st} -> do lateWaitOf st "xmrnone" `shouldReturn` Just LWSupport now <- getCurrentTime alertsAt l (Right stubRate) (pastWindow now 60) - >>= (`shouldSatisfy` logged "ERROR" "invoice inv-xmrnone of order xmrnone: 320950000000 piconero received, 0 piconero confirmed, 0 piconero credited; the Monero plugin shows no confirmation") + >>= (`shouldSatisfy` logged "ERROR" "invoice inv-xmrnone of order xmrnone: 320950000000 piconero received, 0 piconero confirmed, 0 piconero credited; the Monero plugin shows no confirmation of this money, so it is never credited by itself; refund by hand only a transaction confirmed on chain") -- balances with late credits diff --git a/tests/Bots/StoreService/NamesOrdersTests.hs b/tests/Bots/StoreService/NamesOrdersTests.hs index ba7d1ee4cd..3ba6256632 100644 --- a/tests/Bots/StoreService/NamesOrdersTests.hs +++ b/tests/Bots/StoreService/NamesOrdersTests.hs @@ -1092,7 +1092,7 @@ testOneLateAlert = withOrders $ \ctx@Ctx {cStore = st, cWeb} -> do setSignals (cStub ctx) [(ref, SigClosed paid)] logs <- readWith poller refunds logs `shouldBe` 1 - logs `shouldSatisfy` T.isInfixOf "it stays unpaid, and its confirmed money is credited to its balance" + logs `shouldSatisfy` T.isInfixOf "it stays unpaid, and its money is credited to its balance once confirmed, else alerted" restarted <- newPoller refunds <$> readWith restarted `shouldReturn` 0 (nrPhase &&& nrLive) <$> invoiceRegistration ctx inv `shouldReturn` (PUnpaid, False)