From baa4694ea63866fa2aea40ff43733a6f1f75a83f Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Thu, 28 Sep 2023 11:49:21 +0200 Subject: [PATCH 1/6] Fix posthog reset(); update posthog --- ui-dashboard/package-lock.json | 24 +++++++++--------------- ui-dashboard/package.json | 2 +- ui-dashboard/src/app.tsx | 9 --------- ui-payment/package-lock.json | 30 +++++++++--------------------- ui-payment/package.json | 2 +- 5 files changed, 20 insertions(+), 47 deletions(-) diff --git a/ui-dashboard/package-lock.json b/ui-dashboard/package-lock.json index c5a45b4..8f48d3b 100644 --- a/ui-dashboard/package-lock.json +++ b/ui-dashboard/package-lock.json @@ -18,7 +18,7 @@ "date-fns-tz": "^2.0.0", "json5": "^2.2.3", "lodash-es": "4.17.21", - "posthog-js": "1.57.2", + "posthog-js": "1.81.1", "react": "18.2.0", "react-dom": "18.2.0", "react-router-dom": "6.4.4", @@ -5024,11 +5024,11 @@ "license": "MIT" }, "node_modules/posthog-js": { - "version": "1.57.2", - "license": "MIT", + "version": "1.81.1", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.81.1.tgz", + "integrity": "sha512-pQfG9ZGVn3R7Uh1cC/S02trZ6u4TOLs1NhZG3WiNrqMKDA8MJQjZ/PqdkLO0/BeozRBfIbON6pw3xfOIneIclg==", "dependencies": { - "fflate": "^0.4.1", - "rrweb-snapshot": "^1.1.14" + "fflate": "^0.4.1" } }, "node_modules/prelude-ls": { @@ -5926,10 +5926,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rrweb-snapshot": { - "version": "1.1.14", - "license": "MIT" - }, "node_modules/rtl-css-js": { "version": "1.16.0", "license": "MIT", @@ -9826,10 +9822,11 @@ "dev": true }, "posthog-js": { - "version": "1.57.2", + "version": "1.81.1", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.81.1.tgz", + "integrity": "sha512-pQfG9ZGVn3R7Uh1cC/S02trZ6u4TOLs1NhZG3WiNrqMKDA8MJQjZ/PqdkLO0/BeozRBfIbON6pw3xfOIneIclg==", "requires": { - "fflate": "^0.4.1", - "rrweb-snapshot": "^1.1.14" + "fflate": "^0.4.1" } }, "prelude-ls": { @@ -10354,9 +10351,6 @@ "fsevents": "~2.3.2" } }, - "rrweb-snapshot": { - "version": "1.1.14" - }, "rtl-css-js": { "version": "1.16.0", "requires": { diff --git a/ui-dashboard/package.json b/ui-dashboard/package.json index 2abc889..b903704 100644 --- a/ui-dashboard/package.json +++ b/ui-dashboard/package.json @@ -37,7 +37,7 @@ "date-fns-tz": "^2.0.0", "json5": "^2.2.3", "lodash-es": "4.17.21", - "posthog-js": "1.57.2", + "posthog-js": "1.81.1", "react": "18.2.0", "react-dom": "18.2.0", "react-router-dom": "6.4.4", diff --git a/ui-dashboard/src/app.tsx b/ui-dashboard/src/app.tsx index 6bb4079..e443c95 100644 --- a/ui-dashboard/src/app.tsx +++ b/ui-dashboard/src/app.tsx @@ -109,10 +109,6 @@ const App: React.FC = () => { await authProvider.getCookie(); } catch (e) { if (e instanceof AxiosError && e.response?.status === 401) { - if (isPosthogActive) { - posthog?.reset(true); - } - navigate("/login", { state: { isNeedLogout: true @@ -128,10 +124,6 @@ const App: React.FC = () => { setUser(user); } catch (e) { if (e instanceof AxiosError && e.response?.status === 401) { - if (isPosthogActive) { - posthog?.reset(true); - } - navigate("/login", { state: { isNeedLogout: true @@ -180,7 +172,6 @@ const App: React.FC = () => { React.useEffect(() => { if (user && isPosthogActive) { - posthog?.reset(true); posthog?.identify(user.email, { email: user.email, uuid: user.uuid diff --git a/ui-payment/package-lock.json b/ui-payment/package-lock.json index 81ef743..7701ebc 100644 --- a/ui-payment/package-lock.json +++ b/ui-payment/package-lock.json @@ -11,7 +11,7 @@ "@vitejs/plugin-basic-ssl": "^1.0.1", "axios": "^1.1.3", "formik": "^2.2.9", - "posthog-js": "^1.57.2", + "posthog-js": "1.81.1", "qrcode.react": "^3.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -4872,12 +4872,11 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "node_modules/posthog-js": { - "version": "1.57.2", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.57.2.tgz", - "integrity": "sha512-ER4gkYZasrd2Zwmt/yLeZ5G/nZJ6tpaYBCpx3CvocDx+3F16WdawJlYMT0IyLKHXDniC5+AsjzFd6fi8uyYlJA==", + "version": "1.81.1", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.81.1.tgz", + "integrity": "sha512-pQfG9ZGVn3R7Uh1cC/S02trZ6u4TOLs1NhZG3WiNrqMKDA8MJQjZ/PqdkLO0/BeozRBfIbON6pw3xfOIneIclg==", "dependencies": { - "fflate": "^0.4.1", - "rrweb-snapshot": "^1.1.14" + "fflate": "^0.4.1" } }, "node_modules/prelude-ls": { @@ -5268,11 +5267,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rrweb-snapshot": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/rrweb-snapshot/-/rrweb-snapshot-1.1.14.tgz", - "integrity": "sha512-eP5pirNjP5+GewQfcOQY4uBiDnpqxNRc65yKPW0eSoU1XamDfc4M8oqpXGMyUyvLyxFDB0q0+DChuxxiU2FXBQ==" - }, "node_modules/rtl-css-js": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.16.0.tgz", @@ -9438,12 +9432,11 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" }, "posthog-js": { - "version": "1.57.2", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.57.2.tgz", - "integrity": "sha512-ER4gkYZasrd2Zwmt/yLeZ5G/nZJ6tpaYBCpx3CvocDx+3F16WdawJlYMT0IyLKHXDniC5+AsjzFd6fi8uyYlJA==", + "version": "1.81.1", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.81.1.tgz", + "integrity": "sha512-pQfG9ZGVn3R7Uh1cC/S02trZ6u4TOLs1NhZG3WiNrqMKDA8MJQjZ/PqdkLO0/BeozRBfIbON6pw3xfOIneIclg==", "requires": { - "fflate": "^0.4.1", - "rrweb-snapshot": "^1.1.14" + "fflate": "^0.4.1" } }, "prelude-ls": { @@ -9711,11 +9704,6 @@ "fsevents": "~2.3.2" } }, - "rrweb-snapshot": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/rrweb-snapshot/-/rrweb-snapshot-1.1.14.tgz", - "integrity": "sha512-eP5pirNjP5+GewQfcOQY4uBiDnpqxNRc65yKPW0eSoU1XamDfc4M8oqpXGMyUyvLyxFDB0q0+DChuxxiU2FXBQ==" - }, "rtl-css-js": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.16.0.tgz", diff --git a/ui-payment/package.json b/ui-payment/package.json index f349d48..717c9e2 100644 --- a/ui-payment/package.json +++ b/ui-payment/package.json @@ -27,7 +27,7 @@ "@vitejs/plugin-basic-ssl": "^1.0.1", "axios": "^1.1.3", "formik": "^2.2.9", - "posthog-js": "^1.57.2", + "posthog-js": "1.81.1", "qrcode.react": "^3.1.0", "react": "^18.2.0", "react-dom": "^18.2.0", From 75fb5b4c70e3fa513402b9fc0365cd02a90457a6 Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Thu, 28 Sep 2023 11:50:49 +0200 Subject: [PATCH 2/6] Fix ui-dashboard web manifest --- ui-dashboard/index.html | 4 ++-- ui-dashboard/public/fav/browserconfig.xml | 9 --------- ui-dashboard/public/fav/mstile-150x150.png | Bin 8659 -> 0 bytes ui-dashboard/public/fav/site.webmanifest | 19 ------------------- ui-dashboard/public/site.webmanifest | 19 +++++++++++++++++++ 5 files changed, 21 insertions(+), 30 deletions(-) delete mode 100644 ui-dashboard/public/fav/browserconfig.xml delete mode 100644 ui-dashboard/public/fav/mstile-150x150.png delete mode 100644 ui-dashboard/public/fav/site.webmanifest create mode 100644 ui-dashboard/public/site.webmanifest diff --git a/ui-dashboard/index.html b/ui-dashboard/index.html index c3d8054..f6a38f6 100644 --- a/ui-dashboard/index.html +++ b/ui-dashboard/index.html @@ -6,10 +6,10 @@ - + - O2Pay + OxygenPay
diff --git a/ui-dashboard/public/fav/browserconfig.xml b/ui-dashboard/public/fav/browserconfig.xml deleted file mode 100644 index 99f4ca5..0000000 --- a/ui-dashboard/public/fav/browserconfig.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - #333333 - - - diff --git a/ui-dashboard/public/fav/mstile-150x150.png b/ui-dashboard/public/fav/mstile-150x150.png deleted file mode 100644 index 1dabe03408f80c605526ef28e18254edaf05d641..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8659 zcmc(Fby$;c)c*h}LAn_s-5qn3C@tU@q#H&GjDd`hkWykWq#Kk{k&qq;G8$<_sSz8g zOmHX)D8l>r{`dRi_xF44+Ma9AcKY1sKKJK5ssEW9Uc1V36$AoZGd9w*1cAsH{=I3a zfIAV*XEng(ijS_DE(p||Nq6o}349lX8CjZvKo7-0ptvLu=r?dH?lTC4Q~-hY-9R8{ zAqd2YDDAe;1b(3MxMQdXy8QQg*83s{xI-OkY^G1WN5R1?$*AdoQ33dc8tds=MXVf@ zMdivE#%$=QX0Cn8OHvT@OuES>#N>tzdD;!u`)$omb3KXa*8lZ~ox)^&UtA$$!e<9q#sQZp z?;W~;iC&loJ+<%Nj?4WqC?N z4Rd3U07q~|fG`55P*VH$sVsg@w@Ih`r&ijU?m%-gZ6$&-0!kvsi(*g6XQ<2vQ-_ph zr_WhS*pv)&ZWK>O!SE0g6G8yNNVdL;VUwU377uq4AH8F}QpGu>J< zRh<%=GZVw=^LUkfRrT{vfkLEK+LxyY8Lr;XEBV9alsydMTs{Q;S=Cav^rBG1FcU~x zeTEQWEFW&UfM|YN64(E1@p8YO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53:32 +0200 Subject: [PATCH 3/6] Fix ui-payment web manifest --- ui-payment/index.html | 2 +- ui-payment/public/fav/browserconfig.xml | 9 --------- ui-payment/public/fav/mstile-150x150.png | Bin 8659 -> 0 bytes ui-payment/public/fav/site.webmanifest | 19 ------------------- ui-payment/public/site.webmanifest | 19 +++++++++++++++++++ 5 files changed, 20 insertions(+), 29 deletions(-) delete mode 100644 ui-payment/public/fav/browserconfig.xml delete mode 100644 ui-payment/public/fav/mstile-150x150.png delete mode 100644 ui-payment/public/fav/site.webmanifest create mode 100644 ui-payment/public/site.webmanifest diff --git a/ui-payment/index.html b/ui-payment/index.html index 49da74a..d0f54bf 100644 --- a/ui-payment/index.html +++ b/ui-payment/index.html @@ -6,7 +6,7 @@ - + OxygenPay diff --git a/ui-payment/public/fav/browserconfig.xml b/ui-payment/public/fav/browserconfig.xml deleted file mode 100644 index 99f4ca5..0000000 --- a/ui-payment/public/fav/browserconfig.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - #333333 - - - diff --git a/ui-payment/public/fav/mstile-150x150.png b/ui-payment/public/fav/mstile-150x150.png deleted file mode 100644 index 1dabe03408f80c605526ef28e18254edaf05d641..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8659 zcmc(Fby$;c)c*h}LAn_s-5qn3C@tU@q#H&GjDd`hkWykWq#Kk{k&qq;G8$<_sSz8g zOmHX)D8l>r{`dRi_xF44+Ma9AcKY1sKKJK5ssEW9Uc1V36$AoZGd9w*1cAsH{=I3a zfIAV*XEng(ijS_DE(p||Nq6o}349lX8CjZvKo7-0ptvLu=r?dH?lTC4Q~-hY-9R8{ zAqd2YDDAe;1b(3MxMQdXy8QQg*83s{xI-OkY^G1WN5R1?$*AdoQ33dc8tds=MXVf@ zMdivE#%$=QX0Cn8OHvT@OuES>#N>tzdD;!u`)$omb3KXa*8lZ~ox)^&UtA$$!e<9q#sQZp z?;W~;iC&loJ+<%Nj?4WqC?N z4Rd3U07q~|fG`55P*VH$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!IDkyB@B-s8Rg1{h8Kkvx@ zKSAD;r!N5l+lN+mp_cC9f{2hHZ@&O9!O%#Am!Kaa6b3wHQM&b=o+j8vLSp>x#H8_# zC5S?pP7X%LD$IH(hmC?&P%lnp(33*A)k<(;>EqbYdLqu~nTZ@|pOZQC`z_Tx QKm^EG-(0WpmRrLA0E Date: Thu, 28 Sep 2023 21:58:55 +0200 Subject: [PATCH 4/6] Update logger; add more context fields --- go.mod | 4 ++-- go.sum | 7 +++++++ internal/server/http/server.go | 15 +++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index db1e66c..3ff1f1a 100644 --- a/go.mod +++ b/go.mod @@ -26,14 +26,14 @@ require ( github.com/oxygenpay/tatum-sdk v0.0.0-20230529210116-d986b7743613 github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.1 - github.com/rs/zerolog v1.26.1 + github.com/rs/zerolog v1.29.0 github.com/rubenv/sql-migrate v1.2.0 github.com/samber/lo v1.37.0 github.com/spf13/cobra v1.6.1 github.com/stretchr/testify v1.8.1 github.com/tidwall/gjson v1.14.4 github.com/wemeetagain/go-hdwallet v0.1.0 - github.com/ziflex/lecho/v3 v3.1.0 + github.com/ziflex/lecho/v3 v3.5.0 go.etcd.io/bbolt v1.3.6 go.uber.org/atomic v1.10.0 golang.org/x/crypto v0.11.0 diff --git a/go.sum b/go.sum index 764f8c4..6d7479e 100644 --- a/go.sum +++ b/go.sum @@ -104,6 +104,7 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -458,6 +459,7 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -541,11 +543,14 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/rs/zerolog v1.26.0/go.mod h1:yBiM87lvSqX8h0Ww4sdzNSkVYZ8dL2xjZJG1lAuGZEo= github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc= github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc= +github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= +github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/rubenv/sql-migrate v1.2.0 h1:fOXMPLMd41sK7Tg75SXDec15k3zg5WNV6SjuDRiNfcU= github.com/rubenv/sql-migrate v1.2.0/go.mod h1:Z5uVnq7vrIrPmHbVFfR4YLHRZquxeHpckCnRq0P/K9Y= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -636,6 +641,8 @@ github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/ziflex/lecho/v3 v3.1.0 h1:65bSzSc0yw7EEhi44lMnkOI877ZzbE7tGDWfYCQXZwI= github.com/ziflex/lecho/v3 v3.1.0/go.mod h1:dwQ6xCAKmSBHhwZ6XmiAiDptD7iklVkW7xQYGUncX0Q= +github.com/ziflex/lecho/v3 v3.5.0 h1:Z4TBr8SbUUnfaVc8tGJf1Jhu0G9Jxjl77lPW0riXKak= +github.com/ziflex/lecho/v3 v3.5.0/go.mod h1:+eInrytYHxVPI6NQbua9xXGerB1x0ujj9jAV33yBIko= github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= diff --git a/internal/server/http/server.go b/internal/server/http/server.go index bd04b22..9b77e69 100644 --- a/internal/server/http/server.go +++ b/internal/server/http/server.go @@ -91,6 +91,7 @@ func WithLogger(logger *zerolog.Logger) Opt { s.echo.Use(lecho.Middleware(lecho.Config{ Logger: lecho.From(l, lecho.WithLevel(log.INFO)), RequestIDKey: middleware.RequestIDKey, + Enricher: loggerEnricher, Skipper: func(c echo.Context) bool { path := c.Request().URL.Path @@ -106,6 +107,20 @@ func WithLogger(logger *zerolog.Logger) Opt { } } +func loggerEnricher(c echo.Context, logger zerolog.Context) zerolog.Context { + merchantID := c.Param("merchantId") + if merchantID != "" { + logger = logger.Str("merchant_id", merchantID) + } + + paymentID := c.Param("paymentId") + if paymentID != "" { + logger = logger.Str("payment_id", paymentID) + } + + return logger.Str("path", c.Path()) +} + const healthcheckPath = "/health" func withHealthcheck(e *echo.Echo) { From 221661c86c1128df964e075e76e8a7f0b7770ef8 Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Thu, 28 Sep 2023 22:09:48 +0200 Subject: [PATCH 5/6] Fix service version in logs --- cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index b1b55ae..51ea361 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -40,7 +40,7 @@ func Execute() { // resolveConfig or exit with error func resolveConfig() *config.Config { - cfg, err := config.New(Version, Commit, configPath, skipConfig, EmbedFrontend) + cfg, err := config.New(Commit, Version, configPath, skipConfig, EmbedFrontend) if err != nil { fmt.Printf("unable to initialize config: %s\n", err.Error()) os.Exit(1) From 713f062fc92784e4bd2c6281b376083cdd631d05 Mon Sep 17 00:00:00 2001 From: Dmitry S Date: Thu, 28 Sep 2023 23:02:38 +0200 Subject: [PATCH 6/6] Fix withdrawals blocked by a failed item in a batch --- internal/service/payment/service.go | 5 + .../service/payment/service_withdrawal.go | 3 +- .../service/processing/service_withdrawal.go | 55 +++-- .../processing/service_withdrawal_test.go | 212 ++++++++++-------- 4 files changed, 153 insertions(+), 122 deletions(-) diff --git a/internal/service/payment/service.go b/internal/service/payment/service.go index 187ec7d..7c84eaa 100644 --- a/internal/service/payment/service.go +++ b/internal/service/payment/service.go @@ -580,6 +580,11 @@ func (s *Service) Update(ctx context.Context, merchantID, id int64, props Update return s.entryToPayment(pt) } +func (s *Service) Fail(ctx context.Context, pt *Payment) error { + _, err := s.Update(ctx, pt.MerchantID, pt.ID, UpdateProps{Status: StatusFailed}) + return err +} + func (s *Service) SetWebhookTimestamp(ctx context.Context, merchantID, id int64, sentAt time.Time) error { err := s.repo.UpdatePaymentWebhookInfo(ctx, repository.UpdatePaymentWebhookInfoParams{ ID: id, diff --git a/internal/service/payment/service_withdrawal.go b/internal/service/payment/service_withdrawal.go index 51f7163..2293193 100644 --- a/internal/service/payment/service_withdrawal.go +++ b/internal/service/payment/service_withdrawal.go @@ -2,6 +2,7 @@ package payment import ( "context" + "fmt" "strconv" "time" @@ -33,7 +34,7 @@ func (s *Service) ListWithdrawals(ctx context.Context, status Status, filterByID } if len(filterByIDs) > 0 && len(results) != len(filterByIDs) { - return nil, errors.New("results len mismatch") + return nil, fmt.Errorf("withdrawals filter mismatch for status %q", status) } payments := make([]*Payment, len(results)) diff --git a/internal/service/processing/service_withdrawal.go b/internal/service/processing/service_withdrawal.go index fc9aab2..260f0b1 100644 --- a/internal/service/processing/service_withdrawal.go +++ b/internal/service/processing/service_withdrawal.go @@ -23,12 +23,7 @@ func (s *Service) BatchCreateWithdrawals(ctx context.Context, withdrawalIDs []in return nil, err } - // 1.Validate payments - if errValidate := s.validateWithdrawals(withdrawals); errValidate != nil { - return nil, errValidate - } - - // 2. Get OUTBOUND wallets and balances + // 1. Get OUTBOUND wallets and balances outboundWallets, outboundBalances, err := s.getOutboundWalletsWithBalancesAsMap(ctx) if err != nil { return nil, errors.Wrap(err, "unable to get outbound wallets with balances") @@ -36,7 +31,8 @@ func (s *Service) BatchCreateWithdrawals(ctx context.Context, withdrawalIDs []in result := &TransferResult{} - // 3. For each withdrawal: + // 2. For each withdrawal: + // - Validate // - Resolve currency // - Resolve outbound system wallet & balance // - Resolve merchant balance & withdrawal address @@ -47,6 +43,18 @@ func (s *Service) BatchCreateWithdrawals(ctx context.Context, withdrawalIDs []in for i := range withdrawals { withdrawal := withdrawals[i] group.Go(func() error { + // Let's validate each withdrawal individually. + // By doing so, we can reject it without blocking other withdrawals. + if errValidate := validateWithdrawal(withdrawal); errValidate != nil { + if errUpdate := s.payments.Fail(ctx, withdrawal); errUpdate != nil { + result.registerErr(errors.Wrap(errUpdate, "unable to mark invalid withdrawal as failed")) + } else { + result.registerErr(errors.Wrap(errValidate, "withdrawal is invalid, marked as failed")) + } + + return nil + } + currency, err := s.blockchain.GetCurrencyByTicker(withdrawal.Price.Ticker()) if err != nil { result.registerErr(errors.Wrap(err, "unable to get withdrawal currency")) @@ -540,27 +548,26 @@ func (s *Service) cancelWithdrawal( return nil } -func (s *Service) validateWithdrawals(withdrawals []*payment.Payment) error { - for _, pt := range withdrawals { - if pt.Type != payment.TypeWithdrawal { - return errors.Wrap(ErrInvalidInput, "payment is not withdrawal") - } +func validateWithdrawal(pt *payment.Payment) error { + if pt.Type != payment.TypeWithdrawal { + return errors.Wrap(ErrInvalidInput, "payment is not withdrawal") + } - if pt.Status != payment.StatusPending { - return errors.Wrap(ErrInvalidInput, "withdrawal is not pending") - } + if pt.Status != payment.StatusPending { + return errors.Wrap(ErrInvalidInput, "withdrawal is not pending") + } - if pt.MerchantID == 0 { - return errors.Wrap(ErrInvalidInput, "invalid merchant id") - } + if pt.MerchantID == 0 { + return errors.Wrap(ErrInvalidInput, "invalid merchant id") + } - if pt.WithdrawalBalanceID() < 1 { - return errors.Wrap(ErrInvalidInput, "invalid balance id") - } + if pt.WithdrawalBalanceID() < 1 { + return errors.Wrap(ErrInvalidInput, "invalid balance id") + } - if pt.WithdrawalAddressID() < 1 { - return errors.Wrap(ErrInvalidInput, "invalid address id") - } + // edge-case: a customer can delete the address while withdrawal is pending + if pt.WithdrawalAddressID() < 1 { + return errors.Wrap(ErrInvalidInput, "invalid address id") } return nil diff --git a/internal/service/processing/service_withdrawal_test.go b/internal/service/processing/service_withdrawal_test.go index 83e6b1e..e51b984 100644 --- a/internal/service/processing/service_withdrawal_test.go +++ b/internal/service/processing/service_withdrawal_test.go @@ -12,6 +12,7 @@ import ( "github.com/oxygenpay/oxygen/internal/service/blockchain" "github.com/oxygenpay/oxygen/internal/service/merchant" "github.com/oxygenpay/oxygen/internal/service/payment" + "github.com/oxygenpay/oxygen/internal/service/processing" "github.com/oxygenpay/oxygen/internal/service/transaction" "github.com/oxygenpay/oxygen/internal/service/wallet" "github.com/oxygenpay/oxygen/internal/test" @@ -504,7 +505,7 @@ func TestService_BatchCreateWithdrawals(t *testing.T) { }) }) - t.Run("Creates 2 ETH transactions, one failed", func(t *testing.T) { + t.Run("Creates 2 ETH transactions, one fails due to insufficient balance", func(t *testing.T) { tc.Clear.Wallets(t) isTest := false @@ -607,112 +608,129 @@ func TestService_BatchCreateWithdrawals(t *testing.T) { assert.Equal(t, expectedWalletBalance, outboundBalance.Amount.StringRaw()) }) - t.Run("Fails", func(t *testing.T) { + t.Run("Validation error", func(t *testing.T) { tc.Clear.Wallets(t) - t.Run("Validation error", func(t *testing.T) { - mt, _ := tc.Must.CreateMerchant(t, 1) + mt, _ := tc.Must.CreateMerchant(t, 1) - merchantBalance := tc.Must.CreateBalance(t, wallet.EntityTypeMerchant, mt.ID, withBalance(eth, "123_000_000_000_000_000", false)) - merchantAddress, err := tc.Services.Merchants.CreateMerchantAddress(ctx, mt.ID, merchant.CreateMerchantAddressParams{ - Name: "A1", - Blockchain: kmswallet.Blockchain(eth.Blockchain), - Address: "0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5", + merchantBalance := tc.Must.CreateBalance(t, wallet.EntityTypeMerchant, mt.ID, withBalance(eth, "123_000_000_000_000_000", false)) + merchantAddress, err := tc.Services.Merchants.CreateMerchantAddress(ctx, mt.ID, merchant.CreateMerchantAddressParams{ + Name: "A1", + Blockchain: kmswallet.Blockchain(eth.Blockchain), + Address: "0x95222290dd7278aa3ddd389cc1e1d165cc4bafe5", + }) + require.NoError(t, err) + + makeWithdrawal := func(amount money.Money, meta payment.Metadata) *payment.Payment { + entry, err := tc.Repository.CreatePayment(ctx, repository.CreatePaymentParams{ + PublicID: uuid.New(), + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + Type: string(payment.TypeWithdrawal), + Status: string(payment.StatusPending), + MerchantID: mt.ID, + MerchantOrderUuid: uuid.New(), + Price: repository.MoneyToNumeric(amount), + Decimals: int32(amount.Decimals()), + Currency: amount.Ticker(), + Metadata: meta.ToJSONB(), + IsTest: false, }) require.NoError(t, err) - makeWithdrawal := func(amount money.Money, meta payment.Metadata) *payment.Payment { - entry, err := tc.Repository.CreatePayment(ctx, repository.CreatePaymentParams{ - PublicID: uuid.New(), - CreatedAt: time.Now(), - UpdatedAt: time.Now(), - Type: string(payment.TypeWithdrawal), - Status: string(payment.StatusPending), - MerchantID: mt.ID, - MerchantOrderUuid: uuid.New(), - Price: repository.MoneyToNumeric(amount), - Decimals: int32(amount.Decimals()), - Currency: amount.Ticker(), - Metadata: meta.ToJSONB(), - IsTest: false, - }) - require.NoError(t, err) - - pt, err := tc.Services.Payment.GetByID(ctx, mt.ID, entry.ID) - require.NoError(t, err) - - return pt - } - - for testCaseIndex, testCase := range []struct { - errContains string - withdrawals func() []*payment.Payment - }{ - { - // actually "payment is not withdrawal" - errContains: "results len mismatch", - withdrawals: func() []*payment.Payment { - return []*payment.Payment{tc.CreateSamplePayment(t, mt.ID)} - }, + pt, err := tc.Services.Payment.GetByID(ctx, mt.ID, entry.ID) + require.NoError(t, err) + + return pt + } + + for _, tt := range []struct { + name string + assert func(t *testing.T, in []*payment.Payment, result *processing.TransferResult, err error) + withdrawals func() []*payment.Payment + }{ + { + name: "payment is not withdrawal", + withdrawals: func() []*payment.Payment { + return []*payment.Payment{tc.CreateSamplePayment(t, mt.ID)} }, - { - // actually "status is not pending" - errContains: "results len mismatch", - withdrawals: func() []*payment.Payment { - withdrawal, err := tc.Services.Payment.CreateWithdrawal(ctx, mt.ID, payment.CreateWithdrawalProps{ - BalanceID: merchantBalance.UUID, - AddressID: merchantAddress.UUID, - AmountRaw: "0.1", - }) - require.NoError(t, err) - - _, err = tc.Services.Payment.Update(ctx, mt.ID, withdrawal.ID, payment.UpdateProps{Status: payment.StatusInProgress}) - require.NoError(t, err) - - return []*payment.Payment{withdrawal} - }, + assert: func(t *testing.T, _ []*payment.Payment, _ *processing.TransferResult, err error) { + assert.ErrorContains(t, err, `withdrawals filter mismatch for status "pending"`) }, - { - errContains: "invalid address id", - withdrawals: func() []*payment.Payment { - return []*payment.Payment{ - makeWithdrawal( - lo.Must(eth.MakeAmount("123_456")), - payment.Metadata{payment.MetaBalanceID: strconv.Itoa(int(merchantBalance.ID))}, - ), - } - }, + }, + { + name: "status is not pending", + withdrawals: func() []*payment.Payment { + withdrawal, err := tc.Services.Payment.CreateWithdrawal(ctx, mt.ID, payment.CreateWithdrawalProps{ + BalanceID: merchantBalance.UUID, + AddressID: merchantAddress.UUID, + AmountRaw: "0.1", + }) + require.NoError(t, err) + + _, err = tc.Services.Payment.Update(ctx, mt.ID, withdrawal.ID, payment.UpdateProps{Status: payment.StatusInProgress}) + require.NoError(t, err) + + return []*payment.Payment{withdrawal} }, - { - errContains: "invalid balance id", - withdrawals: func() []*payment.Payment { - return []*payment.Payment{ - makeWithdrawal( - lo.Must(eth.MakeAmount("123_456")), - payment.Metadata{payment.MetaAddressID: strconv.Itoa(int(merchantAddress.ID))}, - ), - } - }, + assert: func(t *testing.T, _ []*payment.Payment, _ *processing.TransferResult, err error) { + assert.ErrorContains(t, err, `withdrawals filter mismatch for status "pending"`) }, - } { - t.Run(strconv.Itoa(testCaseIndex+1), func(t *testing.T) { - // ARRANGE - // Given balances - input := testCase.withdrawals() - - // ACT - // Transfer money - ids := util.MapSlice(input, func(p *payment.Payment) int64 { return p.ID }) - result, err := tc.Services.Processing.BatchCreateWithdrawals(ctx, ids) - assert.Nil(t, result) - - // ASSERT - // Check that error contain string - if testCase.errContains != "" { - assert.ErrorContains(t, err, testCase.errContains) + }, + { + name: "invalid address id", + withdrawals: func() []*payment.Payment { + return []*payment.Payment{ + makeWithdrawal( + lo.Must(eth.MakeAmount("123_456")), + payment.Metadata{payment.MetaBalanceID: strconv.Itoa(int(merchantBalance.ID))}, + ), } - }) - } - }) + }, + assert: func(t *testing.T, in []*payment.Payment, result *processing.TransferResult, err error) { + assert.NoError(t, err) + assert.Equal(t, int64(1), result.TotalErrors) + assert.ErrorContains(t, result.UnhandledErrors[0], "withdrawal is invalid, marked as failed") + + pt, _ := tc.Services.Payment.GetByID(ctx, in[0].MerchantID, in[0].ID) + require.NoError(t, err) + assert.Equal(t, payment.StatusFailed, pt.Status) + }, + }, + { + name: "invalid balance id", + withdrawals: func() []*payment.Payment { + return []*payment.Payment{ + makeWithdrawal( + lo.Must(eth.MakeAmount("123_456")), + payment.Metadata{payment.MetaAddressID: strconv.Itoa(int(merchantAddress.ID))}, + ), + } + }, + assert: func(t *testing.T, in []*payment.Payment, result *processing.TransferResult, err error) { + assert.NoError(t, err) + assert.Equal(t, int64(1), result.TotalErrors) + assert.ErrorContains(t, result.UnhandledErrors[0], "withdrawal is invalid, marked as failed") + + pt, _ := tc.Services.Payment.GetByID(ctx, in[0].MerchantID, in[0].ID) + require.NoError(t, err) + assert.Equal(t, payment.StatusFailed, pt.Status) + }, + }, + } { + t.Run(tt.name, func(t *testing.T) { + // ARRANGE + // Given balances + input := tt.withdrawals() + + // ACT + // Create withdrawals + ids := util.MapSlice(input, func(p *payment.Payment) int64 { return p.ID }) + result, err := tc.Services.Processing.BatchCreateWithdrawals(ctx, ids) + + // ASSERT + tt.assert(t, input, result, err) + }) + } }) t.Run("Logic error", func(t *testing.T) {