<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: SleepyGram Project</title>
    <description>The latest articles on DEV Community by SleepyGram Project (@sleepygram_project).</description>
    <link>https://dev.to/sleepygram_project</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4256634%2Faeb2a504-4cad-4f76-82c7-7303d4e93df6.png</url>
      <title>DEV Community: SleepyGram Project</title>
      <link>https://dev.to/sleepygram_project</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sleepygram_project"/>
    <language>en</language>
    <item>
      <title>How SleepyGram splits a 10,000-message selection into Telegram API requests</title>
      <dc:creator>SleepyGram Project</dc:creator>
      <pubDate>Sat, 21 Nov 2026 04:09:52 +0000</pubDate>
      <link>https://dev.to/sleepygram_project/how-sleepygram-splits-a-10000-message-selection-into-telegram-api-requests-40ke</link>
      <guid>https://dev.to/sleepygram_project/how-sleepygram-splits-a-10000-message-selection-into-telegram-api-requests-40ke</guid>
      <description>&lt;p&gt;Moving a few hundred messages from a work chat to a project archive exposes a design problem in desktop clients. People want to pick a range once, while the network request has to stay small and respect the rules of both chats. SleepyGram Desktop, an open-source fork of AyuGram Desktop, keeps those limits separate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Selection size and request size
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/slpkbt/SleepyGram/blob/v7.4.4/README.md#L58-L60" rel="noopener noreferrer"&gt;v7.4.4 README&lt;/a&gt; describes selecting up to 10,000 messages in a single action. On the standard forwarding path, &lt;a href="https://github.com/slpkbt/SleepyGram/blob/v7.4.4/Telegram/SourceFiles/apiwrap.cpp#L133" rel="noopener noreferrer"&gt;the C++ client caps each request at 100 message IDs&lt;/a&gt;. It also starts a new request when the source chat changes, because each forwarding request carries one source chat.&lt;/p&gt;

&lt;p&gt;For a simple selection of 217 ordinary messages from one chat, the cap gives batches of 100, 100, and 17. Across multiple source chats, there can be additional boundaries. The &lt;a href="https://github.com/slpkbt/SleepyGram/blob/v7.4.4/Telegram/SourceFiles/apiwrap.cpp#L4257-L4273" rel="noopener noreferrer"&gt;batching loop&lt;/a&gt; flushes accumulated IDs at either boundary and sends any remainder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Partial failure is part of the operation
&lt;/h2&gt;

&lt;p&gt;Several requests serve one action in the interface. Each request can succeed or fail independently. In &lt;a href="https://github.com/slpkbt/SleepyGram/blob/v7.4.4/Telegram/SourceFiles/apiwrap.cpp#L4183-L4215" rel="noopener noreferrer"&gt;the response handlers&lt;/a&gt;, a successful response passes back the IDs reported as sent. A failure invokes the send-failure handler for the affected request. The &lt;a href="https://github.com/slpkbt/SleepyGram/releases/tag/v7.4.3" rel="noopener noreferrer"&gt;first public release notes&lt;/a&gt; describe reporting partially completed forwards. That distinction matters when a selection includes messages you are allowed to forward and Telegram rejects one of the requests. Otherwise it is hard to tell what you still need to move.&lt;/p&gt;

&lt;h2&gt;
  
  
  A reproducible way to try it
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/slpkbt/SleepyGram/releases/tag/v7.4.4" rel="noopener noreferrer"&gt;v7.4.4 release&lt;/a&gt; has Windows x64, Linux x64, and Apple Silicon macOS builds. The app uses a separate data directory, so you can configure it alongside Telegram Desktop. Start with a test chat and a destination you control. Try a selection just over 100 messages and compare the expected count with what reaches the destination. Forwarding still depends on Telegram and the permissions of the chats involved.&lt;/p&gt;

&lt;p&gt;If you’ve shipped a similar bulk action in a desktop client, how did you show a partially completed result? In particular, I’m interested in how you let users retry only the failed items without creating duplicates.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: This article was generated by Codex on behalf of the SleepyGram project. The examples and implementation notes were checked against the linked release and source.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
