chart/static
Chris Amow a13a54bc3f Drop stale bar events instead of letting the chart throw
Cannot update oldest data appeared in the console once ticks were live.
Switching timeframe races: the server answers subscribe with a fresh snapshot
from one coroutine while another is still draining bar events for the timeframe
just left, so a 1m bar can arrive after the 1h snapshot. Against the 1h series
it is older than every point in it, and Lightweight Charts throws rather than
ignoring it, which takes the app down instead of dropping one bar.

The race predates the tick feed. Level 1 made bar events about fifteen times
more frequent, which is what surfaced it.

Guarded at both ends. app.js honours the tf each event already carries and drops
anything for a timeframe no longer selected. chart.js refuses a bar older than
the series' last point whatever its origin, since a bar behind the last one has
nothing to contribute.

Verified: 36 rapid timeframe switches under a live tick feed produce zero
console errors, and calling candles.update() directly with a stale bar still
throws while the guarded updateBar() does not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 06:30:56 -05:00
..
app.js Drop stale bar events instead of letting the chart throw 2026-08-10 06:30:56 -05:00
chart.js Drop stale bar events instead of letting the chart throw 2026-08-10 06:30:56 -05:00
index.html Add Font Awesome 7.3.1 and move the tool glyphs onto it 2026-08-10 06:10:28 -05:00
style.css Price trendlines across bars, add one-shot alerts, collapse layers, drop 1h MAs 2026-08-10 04:15:05 -05:00