Skip to content

fix(updater): a short Yahoo chart never shrinks the published history - #98

Merged
daggerok merged 1 commit into
mainfrom
fix/short-chart-keeps-history
Oct 30, 2026
Merged

daggerok merged 1 commit into
mainfrom
fix/short-chart-keeps-history

Conversation

@daggerok

Copy link
Copy Markdown
Owner

What

The chart step in scripts/update-data.ts calls mergeWindowedChart for every fresh chart, not only when period1 > 0; error text names the range and fresh day count. The Q25 range test is extended with a truncated default-range chart.

Why

With HISTORY_RANGE=max a truncated Yahoo answer replaced the published history (2026-10-29: Franklin DVAL and USFI, 999 rows to one). A full max answer starts at inception, so the merge returns it unchanged.

Checks

  • bun test: 66 pass, also with config defaults exported
  • the extended test fails on the old code (1 fail) and passes with the fix
  • tc check.sh prints nothing; git diff --check clean
  • live: TICKERS="AGGY AGZD" run, history -1 on each (a full max answer is returned unchanged by the merge, so identical to the old code); api reverted, no data commit

The shared merge ran only when the Yahoo request had a period1 window, so with the default max a truncated Yahoo answer replaced the published history (2026-10-29: Franklin DVAL and USFI went from 999 rows to one). The merge now runs for every fresh chart; a full max answer starts at inception and comes back unchanged, one that does not join the published days counts as a failed chart and the fund is kept.
@daggerok
daggerok merged commit 37bcb9c into main Oct 30, 2026
1 check passed
@daggerok
daggerok deleted the fix/short-chart-keeps-history branch October 30, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant