diff --git a/data/web/corefork.telegram.org/api/updates.html b/data/web/corefork.telegram.org/api/updates.html index 831ba5ec01..b76bab92a4 100644 --- a/data/web/corefork.telegram.org/api/updates.html +++ b/data/web/corefork.telegram.org/api/updates.html @@ -133,8 +133,8 @@ Since local_pts + pts_count < pts (137 < 140), t

If the updates were applied, local Updates state must be updated with seq (unless it's 0) and date from the constructor.

For all the other Updates type constructors there is no need to check seq or change a local state.

Recovering gaps

-

To do this, updates.getDifference (common/secret state) or updates.getChannelDifference (channel state) with the respective local states must be called. -These methods should also be called on startup, to fetch new updates (preferably with some flags to reduce server load, see the method's docs). +

To do this, updates.getDifference (common/secret state) or updates.getChannelDifference (channel state) with the respective local states must be called.
+Only updates.getDifference should also be called on startup, to fetch new updates (preferably with some flags to reduce server load, see the method's docs).
Manually obtaining updates is also required in the following situations:

When calling updates.getDifference if the updates.differenceSlice constructor is returned in response, the full difference was too large to be received in one request. The intermediate status, intermediate_state, must be saved on the client and the query must be repeated, using the intermediate status as the current status.

-

To fetch the updates difference of a channel, updates.getChannelDifference is used. -If the difference is too large to be received in one request, the final flag of the result is not set (see docs). -The intermediate status, represented by the pts, must be saved on the client and the query must be repeated, using the intermediate status as the current status.

+

To fetch the updates difference of a channel, updates.getChannelDifference is used.
+If the difference is too large to be received in one request, the final flag of the result is not set (see docs).
+The intermediate status, represented by the pts, must be saved on the client and the query must be repeated, using the intermediate status as the current status.

For performance reasons and for better user experience, client can set maximum gap size to be filled: pts_total_limit parameter of updates.getDifference and limit parameter for updates.getChannelDifference can be used.

If the gap is too large and there are too many updates to fetch, a *TooLong constructor will be returned. In this case, the client must re-fetch the state, re-start fetching updates from that state and follow the instructions that can be found here.

If the returned channel difference is final and the timeout flag is set, updates.getChannelDifference should be re-invoked after timeout seconds.