perf: reuse authorized chat snapshot when reading history

This commit is contained in:
2026-11-15 19:33:13 +03:00
parent fa3a69d9b4
commit cabd0cacb3
52 changed files with 256655 additions and 6 deletions
+2 -2
View File
@@ -268,13 +268,13 @@ async def send(request: Request, chat_id: str):
async def history(request: Request, chat_id: str):
user = await actor(request)
cid = parse_uuid(chat_id)
await run_io(service(request).get_chat, actor_id=user.id, chat_id=cid)
chat = await run_io(service(request).get_chat, actor_id=user.id, chat_id=cid)
limit, cursor = pagination(request)
return response(
await run_io(
service(request).history,
actor_id=user.id,
chat_id=cid,
chat=chat,
limit=limit,
cursor=cursor,
)