From 338a700b3a87a1c3215bc5f0c3d397f619e54643 Mon Sep 17 00:00:00 2001 From: NW Date: Sat, 8 Aug 2026 23:46:56 +0100 Subject: [PATCH] =?UTF-8?q?fix(bot):=20issue=20#143=20=E2=80=94=20sleep=20?= =?UTF-8?q?mode=20safety=20guards=20+=20super-admin=20seed=20access?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sleepGuard.js: assertShopOpen/redirectIfPaused — blocks write-flows on shop pause, redirects to AI dialog, fallback to sleep message - Blocked: buy/pay/quantity/top-up/deposit/wallet-create when paused - Soft redirect: catalog navigation (country/city/district/category/product) to AI on pause - Read-only flows untouched (purchase history, balance, tx history) - Tests: 10 sleepGuard tests (T1-T6 + alias + fallback), 42 total pass - fix(admin): super-admin seed phrases not blocked by commission (informational only) - wallet test mock updated for sleepGuard --- .../src/components/wallets/wallets-page.tsx | 6 +- src/__tests__/sleepGuard.test.js | 432 ++++++++++++++++++ src/__tests__/userProductHandler.test.js | 6 + .../userHandlers/userProductHandler.js | 100 ++++ .../userHandlers/wallet/createHandler.js | 20 + .../userHandlers/wallet/depositHandler.js | 28 ++ .../userHandlers/wallet/topUpHandler.js | 10 + src/utils/sleepGuard.js | 56 +++ 8 files changed, 655 insertions(+), 3 deletions(-) create mode 100644 src/__tests__/sleepGuard.test.js create mode 100644 src/utils/sleepGuard.js diff --git a/admin-next/src/components/wallets/wallets-page.tsx b/admin-next/src/components/wallets/wallets-page.tsx index 8969955..71525c5 100755 --- a/admin-next/src/components/wallets/wallets-page.tsx +++ b/admin-next/src/components/wallets/wallets-page.tsx @@ -938,7 +938,7 @@ export function WalletsPage() { {isSuperAdmin && ( <> - {/* Commission Warning */} + {/* Commission Warning — информационное, НЕ блокирует супер-админа */} {overview && overview.commissionDue > 0 && (
@@ -947,7 +947,7 @@ export function WalletsPage() { Outstanding Commission: ${overview.commissionDue.toFixed(2)}

- Please pay the outstanding commission before accessing seed phrases. + Reminder: the shop commission is due. Super admins always have full access to seed phrases.

@@ -962,7 +962,7 @@ export function WalletsPage() {