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

@@ -28,7 +28,7 @@
<svg class="sa-icon sa-thin">
<use href="/icons/sprite.svg#tag"></use>
</svg>
<span class="fs-xs opacity-70">v1.2.1</span>
<span class="fs-xs opacity-70">v1.2.2</span>
</div>
</div>
</aside>
@@ -43,10 +43,10 @@
</div>
<div class="modal-body">
<div class="alert alert-info mb-3">
<strong>Current:</strong> v1.2.1 &middot; 2026-07-18
<strong>Current:</strong> v1.2.2 &middot; 2026-08-04
</div>
<h6 class="fw-bold mb-2">v1.2.1 <span class="text-muted fs-sm">&mdash; 2026-07-18</span></h6>
<h6 class="fw-bold mb-2">v1.2.2 <span class="text-muted fs-sm">&mdash; 2026-08-04</span></h6>
<ul class="small mb-3">
<li><span class="badge bg-info">refactor</span> Removed deposit amount-selection step; deposit_wallet_ now goes directly to Mercuryo instructions</li>
<li><span class="badge bg-primary">feat</span> Updated Mercuryo button text to include VISA/Mastercard branding in all locales</li>