addons-cm/website_sale_aplicoop/static/src
GitHub Copilot 965c5c2495 [FIX] website_sale_aplicoop: stamp localStorage cart with cycle and evict on rollover
The cart was reappearing on stage with ghost items that had never been
saved as drafts on the server. Root cause: the localStorage cart had no
cycle awareness. Users who added items but never clicked Save left the
items in localStorage forever, and the only existing eviction path
(_clearCurrentOrderCartSilently via _checkGroupOrderStatus) only fires
when cutoff_passed flips true — which it rarely does, because the
stored cutoff_date is normally in the future for an active cycle. On
the next visit, _loadCart happily rehydrated the stale items and
_autoLoadDraftOnInit short-circuited because the cart was no longer
empty.

Stamp every cart written to localStorage with the cutoff_date it
belongs to and reject on cycle mismatch in _loadCart. The cutoff_date
is captured from /eskaera/check-status (which already returned it).
Legacy unstamped values and corrupt JSON are also dropped, so existing
browsers self-heal on first reload after the deploy.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 15:14:04 +02:00
..
css group order form notebook 2026-05-21 17:37:22 +02:00
js [FIX] website_sale_aplicoop: stamp localStorage cart with cycle and evict on rollover 2026-06-04 15:14:04 +02:00