fix(intraday): mark a chart from before the latest session

stocks intraday never set quote.behind_session, so on a holiday or when
Stockbit lags, a past session's chart read as current. Mark it as quotes
do and print the same note under the header.

Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY
This commit is contained in:
Rasyidan Akbar F. 2026-11-04 17:24:42 +07:00
commit 6f8d3c071a
10 changed files with 20 additions and 9 deletions

View file

@ -75,7 +75,7 @@ impl Market<'_> {
let idx = self.idx;
let resolved = idx.resolve(symbol)?;
let provider = intraday_provider();
cached_fetch(
let mut day = cached_fetch(
&idx.cache,
CacheSpec {
bucket: "stockbit-intraday",
@ -87,7 +87,11 @@ impl Market<'_> {
policy,
|| provider.intraday(&resolved),
Ok,
)
)?;
// Stockbit's page keeps the last session's chart up after the close,
// so a cached or lagging day reads as current unless it is marked.
mark_behind_session(&mut day.data.quote, latest_session(Utc::now()));
Ok(day)
}
/// Resolves the history source for an optional `--history-provider`