From b58087f37bde7073c0899330411a70b31dc45327 Mon Sep 17 00:00:00 2001 From: NW Date: Tue, 4 Aug 2026 20:53:34 +0100 Subject: [PATCH] =?UTF-8?q?fix(bot):=20issue=20#128=20=E2=80=94=20empty=20?= =?UTF-8?q?category=20menus,=20duplicate=20country=20lists,=20DB=20typo+de?= =?UTF-8?q?sync=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - getCategoriesWithProductsByLocationId: filter districts to categories with real in-stock/mono products; empty → no_categories message + back button + answerCallbackQuery - Main-menu debounce (1200ms) in routes.js for products/profile/wallets/purchases — no duplicate Select-your-country on rapid taps - Migration 012: fix typos (Centr→Center, Chiken→Chicken, Brusel→Brussels, Sever→North) + re-enable locations that have in-stock products (desync fix) - Tests updated (48 pass); bump v1.2.3 --- VERSION.md | 8 +++- src/__tests__/botBugFixes.test.js | 3 +- src/admin/views/partials/app-sidebar.ejs | 6 +-- .../userHandlers/userProductHandler.js | 19 +++++++++- src/i18n/locales/de.json | 1 + src/i18n/locales/en.json | 1 + src/i18n/locales/es.json | 1 + src/migrations/012_fix_typos.js | 38 +++++++++++++++++++ src/migrations/runner.js | 1 + src/router/routes.js | 20 ++++++++++ src/services/categoryService.js | 14 +++++++ 11 files changed, 106 insertions(+), 6 deletions(-) create mode 100644 src/migrations/012_fix_typos.js diff --git a/VERSION.md b/VERSION.md index 661234e..3c9f9e9 100644 --- a/VERSION.md +++ b/VERSION.md @@ -9,10 +9,16 @@ ## Current Version -**v1.2.2** — 2026-08-04 +**v1.2.3** — 2026-08-04 ## Changelog +### v1.2.3 — 2026-08-04 +- **fix**: empty category menus — districts with no in-stock products show "No products available in this district" (getCategoriesWithProductsByLocationId filters by real stock/mono) +- **fix**: duplicate "Select your country" messages on rapid Products tap — 1200ms main-menu debounce in routes.js +- **fix**: DB typos + desync — migration 012 (Centr→Center, Chiken→Chicken, Brusel→Brussels, Sever→North) and re-enables locations that actually have in-stock products +- **fix**: answerCallbackQuery on no_categories branch (no stuck loading spinner) + ### v1.2.2 — 2026-08-04 - **fix**: BUG-01 — disabled locations/categories/subcategories filtered from bot menus (getActiveLocationById, is_active checks) - **fix**: BUG-02 — graceful handling of disabled entity during purchase flow (location_disabled notice + main-menu redirect, no crash) diff --git a/src/__tests__/botBugFixes.test.js b/src/__tests__/botBugFixes.test.js index a072436..b2db826 100644 --- a/src/__tests__/botBugFixes.test.js +++ b/src/__tests__/botBugFixes.test.js @@ -92,7 +92,8 @@ vi.mock('../services/userService.js', () => ({ vi.mock('../services/categoryService.js', () => ({ __esModule: true, default: { - getCategoriesByLocationId: vi.fn().mockResolvedValue([]) + getCategoriesByLocationId: vi.fn().mockResolvedValue([]), + getCategoriesWithProductsByLocationId: vi.fn().mockResolvedValue([]) } })); diff --git a/src/admin/views/partials/app-sidebar.ejs b/src/admin/views/partials/app-sidebar.ejs index d87e6c3..af91c4a 100644 --- a/src/admin/views/partials/app-sidebar.ejs +++ b/src/admin/views/partials/app-sidebar.ejs @@ -28,7 +28,7 @@ - v1.2.2 + v1.2.3 @@ -43,10 +43,10 @@