fix(bot): issue #127 — active-state sync, disabled-entity handling, double-tap lock, state reset

- BUG-01: getActiveLocationById + product availability checks (loc_active/cat_active) — disabled locations/categories filtered from bot menus
- BUG-02: graceful redirect to main menu (location_disabled notice) when entity disabled mid-flow, no crash in handleDistrictSelection/handleProductSelection/handleBuyProduct/handlePay
- BUG-03: per-user callback lock (LOCK_MS 1500ms debounce) in utils/callbackLock.js — duplicate taps dropped
- BUG-04: resetUserContext clears tracked photo/product messages + userStates on main-menu navigation and /start
- fix: handlePay uses validated numeric quantity (was raw string) for price/stock/purchase writes
- tests: 7 new (botBugFixes.test.js), updated userProductHandler tests — 30 total pass
- bump v1.2.2
This commit is contained in:
NW
2026-08-04 15:21:55 +01:00
parent 29ab8f9d34
commit bd3391c111
15 changed files with 416 additions and 18 deletions

View File

@@ -54,6 +54,8 @@
"error_loading_categories": "Error al cargar categorías. Inténtalo de nuevo.",
"error_loading_product": "Error al cargar detalles del producto. Inténtalo de nuevo.",
"not_found": "Ubicación no encontrada. Volviendo al menú anterior.",
"location_disabled": "Esta ubicación ya no está disponible.",
"back_to_main": "🏠 Menú Principal",
"mono_product": "📦 Producto Digital",
"infinite_stock": "∞ Siempre disponible",
"no_description": "Sin descripción",