Skip to content

Commit 561f0b8

Browse files
authored
fix: resolve chat search returning no results due to limit mismatch (#73)
The search bar sent limit=1000 but the API enforced le=500, causing FastAPI to reject every search request with a silent 422 error. Also fixed DISPLAY_CHAT_IDS mode ignoring the search parameter entirely.
1 parent b629846 commit 561f0b8

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ For upgrade instructions, see [Upgrading](#upgrading) at the bottom.
66

77
## [Unreleased]
88

9+
## [6.2.15] - 2026-02-15
10+
11+
### Fixed
12+
13+
- **Chat search broken (silent 422 error)** — The search bar sent `limit=1000` but the API enforced `le=500`, causing FastAPI to reject every search request with a 422 validation error. The frontend silently swallowed the error, making search appear to return no results. Raised the API limit to 1000 to match the frontend.
14+
- **Chat search ignored in DISPLAY_CHAT_IDS mode** — When `DISPLAY_CHAT_IDS` was configured, the search query was never passed to the database, so typing in the search bar had no effect on the displayed chats.
15+
916
## [6.2.14] - 2026-02-13
1017

1118
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "telegram-archive"
7-
version = "6.2.14"
7+
version = "6.2.15"
88
description = "Automated Telegram backup with Docker. Performs incremental backups of messages and media on a configurable schedule."
99
readme = "README.md"
1010
requires-python = ">=3.14"

src/web/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def _get_cached_avatar_path(chat_id: int, chat_type: str) -> str | None:
531531

532532
@app.get("/api/chats", dependencies=[Depends(require_auth)])
533533
async def get_chats(
534-
limit: int = Query(50, ge=1, le=500, description="Number of chats to return"),
534+
limit: int = Query(50, ge=1, le=1000, description="Number of chats to return"),
535535
offset: int = Query(0, ge=0, description="Offset for pagination"),
536536
search: str = Query(None, description="Search query for chat names/usernames"),
537537
archived: bool | None = Query(None, description="Filter by archived status"),
@@ -548,7 +548,7 @@ async def get_chats(
548548
# If display_chat_ids is configured, we need to load all matching chats
549549
# Otherwise, use pagination
550550
if config.display_chat_ids:
551-
chats = await db.get_all_chats(archived=archived, folder_id=folder_id)
551+
chats = await db.get_all_chats(search=search, archived=archived, folder_id=folder_id)
552552
chats = [c for c in chats if c["id"] in config.display_chat_ids]
553553
total = len(chats)
554554
# Apply pagination after filtering

0 commit comments

Comments
 (0)