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> |
||
|---|---|---|
| .. | ||
| css | ||
| js | ||