Skip to content

fix(messages): make search_global pages different - #343

Merged
chigwell merged 1 commit into
chigwell:mainfrom
axisrow:fix/search-global-pages
Oct 21, 2026
Merged

chigwell merged 1 commit into
chigwell:mainfrom
axisrow:fix/search-global-pages

Conversation

@axisrow

@axisrow axisrow commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

search_global paginated with add_offset=offset, but messages.searchGlobal does not support an offset — Telethon silently ignores it for a global search, so every requested page returned the same first-page results.

The fix fetches up to the end of the requested page (limit=offset + page_size) and slices off everything before offset, letting Telethon page through the result set itself. Page 1 behaves exactly as before.

Testing

  • tests/test_search_global_pages.py asserts page 2 differs from page 1.
  • Full suite: 1409 passed.

🤖 Generated with Claude Code

messages.searchGlobal has no add_offset, which Telethon silently ignores for a global search, so page 2 and 3 returned the same messages as page 1 and older results were unreachable. Fetch up to the end of the requested page, letting Telethon page through the results, and keep only that page.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018Xun6C4mXUAKbVSmiEEh79
@chigwell
chigwell merged commit 9a9e443 into chigwell:main Oct 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants