Skip to content

fix(portfolio): correct holiday quotes and speed up holding edits - #169

Merged
TNT-Likely merged 3 commits into
mainfrom
codex/fix-market-holidays
Oct 1, 2026
Merged

TNT-Likely merged 3 commits into
mainfrom
codex/fix-market-holidays

Conversation

@TNT-Likely

@TNT-Likely TNT-Likely commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Background

On exchange holidays, the portfolio page could show a midday break and reuse the previous session's percentage changes as today's P&L. Saving account or position changes also waited for the entire K-line summary batch, delaying visible updates when providers were slow.

Changes

  • Market data: share exchange-local session status across market badges and scheduling, add offline 2026 CN/HK/US holiday and early-close calendars, and retain Tencent CN/HK source quote dates.
  • Portfolio: suppress unavailable daily changes while retaining last prices and accumulated P&L; exclude closed markets and outdated quotes from today's P&L.
  • Frontend: refresh market badges periodically, display inactive daily values in neutral colors, and explain retained quotes with source dates.
  • Refresh flow: apply saved metadata using existing quotes, fetch missing quotes and new-symbol K-line summaries in the background, and allow mutation refreshes to reuse cached FX rates.
  • K-line API: deduplicate identical market/symbol requests within a batch while preserving response order and per-item errors.

Validation

  • python -m pytest tests/ -x -q: 924 passed, 3 skipped; the related backend suite also passed all 86 tests.
  • pnpm exec vitest run tests/portfolio tests/api/klines.test.ts tests/settings/market-colors.test.tsx: 15 passed, including account creation and position edits while K-line requests remain pending.
  • python -m pytest packages/marketdata/tests -q: 188 passed.
  • pnpm build, pnpm check:i18n, and pnpm check:market-colors: passed.
  • git diff --check: passed.

Boundaries and risks

  • Offline exchange calendars cover 2026; CN continues to refresh its online calendar. Uncovered years retain the existing weekday fallback.
  • Source-date freshness checks apply when a provider supplies a quote date; Tencent CN/HK parsing is included, while US timestamp conventions are not guessed.
  • Cold K-line requests can still be slow; they no longer delay portfolio mutation updates.
  • Mutation refreshes reuse cached FX rates. Initial and normal portfolio loads retain FX refresh behavior.
  • Local frontend validation used Node 20; repository CI uses the specified Node 24 runtime.

Follow-up

  • Update offline exchange holiday and early-close calendars when the next annual schedules are published.

@TNT-Likely
TNT-Likely merged commit 00b345b into main Oct 1, 2026
3 checks passed
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