2.2.3.199 WindowSize

The WindowSize element is an optional child element of the Collection element and the Sync element in Sync command requests that specifies a maximum number of changed items in a collection or a request that SHOULD be included in the synchronization response.

Elements referenced in this section are defined in the AirSync namespace, except where otherwise indicated by the presence of a namespace prefix (as defined in section 2.2.4).

Command request/response

Parent elements

Child elements

Data type

Number allowed

Sync command request (section 2.2.1.21)

Collection (section 2.2.3.29.2)

Sync (section 2.2.3.180)

None

integer ([MS-ASDTYPE] section 2.6)

0...1 (optional)

The maximum value for the WindowSize element is 512. However, if the WindowSize element is set to 512, the server can send Sync response messages that contain less than 512 updates. If the server does not send all the updates in a single message, the Sync response message contains the MoreAvailable element (section 2.2.3.116), which indicates that there are additional updates on the server to be downloaded to the client.

The WindowSize element appears only in requests that are sent to the server from the client. If the WindowSize element is omitted, the server behaves as if a WindowSize element with a value of 100 were submitted. The server interprets the value 0 (zero) and values above 512 as 512.

WindowSize element values less than 100 increase the load on the server, increase bandwidth, and decrease battery life because of the additional requests that are required to obtain all changes. WindowSize element values larger than 100 cause larger responses, which are more susceptible to communication errors. A WindowSize element value less than 100 can be useful if the client can display the initial set of objects while additional ones are still being retrieved from the server.

If the number of changes on the server is greater than the value of the WindowSize element, the server returns a MoreAvailable element in the response. If this occurs, the client MUST synchronize again to continue getting items from the server.

The WindowSize element has been repurposed to also impose a global limit on the number of changes that are returned by the server. The WindowSize element value can still be specified at the collection level and the server MUST honor both the global and collection level settings.

Collections are to be processed by the server in the order received, as follows:

§ If the server has filled the WindowSize on a particular collection that has more changes, it will return the MoreAvailable element for that collection and continue to process the other collections until the global WindowSize has been filled.

§ When the server has filled the global WindowSize and collections that have changes did not fit in the response, the server can return a MoreAvailable element.

§ If a collection is not present in a Sync command response, the client can assume that no changes are currently available for that collection.

The actual number of changes that are included in a Sync command response for any particular collection depends on the value of the WindowSize element of the collection, the overall number of changes that are already included in the response, and the value of the global WindowSize element. The server will stop processing after the global WindowSize has been filled and simply not process the remaining collections. Any server-side changes that are pending in the unprocessed collections are picked up in the next synchronization.

Protocol Versions

The following table specifies the protocol versions that support this element. The client indicates the protocol version being used by setting either the MS-ASProtocolVersion header, as specified in [MS-ASHTTP] section 2.2.1.1.2.6, or the Protocol version field, as specified in [MS-ASHTTP] section 2.2.1.1.1.1, in the request.

Protocol version

Element support

2.5

Yes

12.0

Yes

12.1

Yes

14.0

Yes

14.1

Yes

16.0

Yes

16.1

Yes