feat(api,userbot,frontend): fetch only new messages in backfill by default

This commit is contained in:
hh
2026-08-06 12:30:37 +02:00
parent 6b6edc9a0d
commit ee63f8b783
9 changed files with 76 additions and 25 deletions
+2 -1
View File
@@ -16,6 +16,7 @@ class BackfillRequest(BaseModel):
account_id: int
chat_id: int
media: bool = False
full: bool = False
class FetchMediaRequest(BaseModel):
@@ -70,7 +71,7 @@ async def enqueue_backfill(
pool,
body.account_id,
"backfill",
{"chat_id": body.chat_id, "media": body.media},
{"chat_id": body.chat_id, "media": body.media, "full": body.full},
)
return EnqueueResponse(job_id=job_id)
+4 -1
View File
@@ -103,7 +103,10 @@ async def track_chat(
await enqueue(pool, body.account_id, "enrich_chat", {"chat_id": chat_id})
if body.backfill:
await enqueue(
pool, body.account_id, "backfill", {"chat_id": chat_id, "media": True}
pool,
body.account_id,
"backfill",
{"chat_id": chat_id, "media": True, "full": True},
)
return await discover.get_item(pool, body.account_id, chat_id)