Add system alerts log with nav badge and Admin Alerts tab.
Deploy / lint (push) Successful in 8s
Deploy / test (push) Failing after 1m4s
Deploy / deploy (push) Has been skipped

Persist job and ingestion warnings/errors for 7 days, surface a dismissible top-nav badge, treat stale OHLCV as a warning (e.g. ticker renames), and show market bar age on the ticker freshness chip.
This commit is contained in:
2026-07-14 13:38:04 +02:00
parent ed82d0a665
commit f59c0c3484
16 changed files with 825 additions and 7 deletions
+27
View File
@@ -60,3 +60,30 @@ async def test_empty_fetch_with_existing_history_is_up_to_date(session):
assert result.status == "complete"
assert result.records_ingested == 0
async def test_empty_fetch_with_stale_history_reports_stale(session):
# Provider returns nothing but last stored bar is weeks old — classic
# rename/delist case (e.g. SATS after it became ECHO). Must not look like success.
await _add_ticker(session, "SATS")
today = date.today()
old = [
OHLCVData(
ticker="SATS",
date=today - timedelta(days=20 + i),
open=100.0,
high=101.0,
low=99.0,
close=100.0,
volume=1000,
)
for i in range(3)
]
await svc.fetch_and_ingest(session, MockMarketDataProvider(ohlcv_data=old), "SATS")
result = await svc.fetch_and_ingest(session, MockMarketDataProvider(ohlcv_data=[]), "SATS")
assert result.status == "stale"
assert result.records_ingested == 0
assert result.last_date is not None
assert "renamed" in (result.message or "").lower() or "halted" in (result.message or "").lower()