Refresh visible news risk ratings after analysis
Development CI / check-and-build (push) Successful in 1m29s
GitHub Git mirror / mirror (push) Successful in 6s
Development CI / deploy-development (push) Failing after 5s

Poll only visible news IDs and update ratings for matching revisions without replacing the feed, scrolling, or clearing pending-news notifications. Bind refresh results to the page and session, and cover stale responses and bounded ID queries.
This commit is contained in:
eezd committed 2026-10-30 18:41:03 +08:00
1 parent 4f43ca8b57
commit 91bc65df75
7 files changed
+101 -3

No files matched your search

+4
View File
@@ -46,6 +46,10 @@ async def main():
response.raise_for_status()
assert response.json()['code'] == 0, path
assert 'CI synthetic news' in (await client.get('/api/news?q=CI')).text
item = (await client.get('/api/news?q=CI')).json()['data']['items'][0]
selected = await client.get('/api/news', params=[('ids', item['id']), ('ids', 2147483647)])
assert selected.status_code == 200 and [n['id'] for n in selected.json()['data']['items']] == [item['id']]
assert (await client.get('/api/news', params=[('ids', n) for n in range(101)])).status_code == 422
assert 'CI CPI' in (await client.get('/api/calendar?start=' + now.strftime('%Y-%m-%d'))).text
for path in ['/', '/home', '/news', '/calendar', '/crawler', '/market', '/trading', '/chat', '/skills', '/settings']:
response = await client.get(path)