3.1.4.3.3 Refresh Coauthoring Session

If the CoauthRequestType attribute is set to "RefreshCoauthoring", the protocol server considers this coauthoring subrequest to be of type, "Refresh coauthoring session". The protocol server refreshes the client’s timeout of the shared lock on the coauthorable file and checks the coauthoring status of the file.

The protocol server refreshes the shared lock on the file. If the refresh of the shared lock on the file for that specific client fails because the file is no longer locked since the timeout value expired on the lock in the file coauthoring tracker, the protocol server does one of the following:

  • If the coauthoring feature is enabled on the protocol server, the server considers this coauthoring subrequest to be of type, "Join coauthoring session", and it gets a new shared lock on the file.

  • If the coauthoring feature is disabled, then the protocol server returns an error code value set to "FileNotLockedOnServer".<46>

The Timeout attribute is defined in section 2.3.1.5, and the file coauthoring tracker is defined in section 3.1.1.

After the protocol server has ensured that there is a shared lock with the same schema lock identifier used by the current client and that the client is sharing the shared lock on the file, the protocol server MUST update the client’s timeout on the shared lock on the file. The new timeout value is the timeout value sent as part of the coauthoring subrequest. If the client is sending a request to refresh the shared lock with a timeout value less than or equal to the current timeout on the shared lock, the protocol server considers the coauthoring subrequest of type "Refresh coauthoring session" to be a no-operation instruction and does nothing. If the client is sending a request to refresh the shared lock with a timeout value greater than the current timeout on the shared lock, the protocol server updates the file coauthoring tracker with the new timeout value for that specific client and that specific file. The Timeout attribute is defined in section 2.3.1.5, and the file coauthoring tracker is defined in section 3.1.1.

To get the coauthoring status, the protocol server checks the number of clients editing the file at that instant in time. If the current client is the only client editing the file, the protocol server MUST return a CoauthStatus set to "Alone", which indicates that no one else is editing the file. If the current client is the second, third, or later coauthor joining the coauthoring session, the protocol server MUST return a CoauthStatus set to "Coauthoring", which indicates that the current client is coauthoring when editing the document. The CoauthStatus attribute sent as part of the SubResponseData element is defined in section 2.2.8.2.

If there is a current exclusive lock on the file or a shared lock on the file with a different schema lock identifier, the protocol server returns an error code value set to "FileAlreadyLockedOnServer". If the coauthorable file is checked out on the server and checked out by a client with a different user name than the current client, the protocol server returns an error code value set to "FileAlreadyCheckedOutOnServer".

If any failure occurs such that the subrequest cannot be processed successfully, the protocol server returns an error. The error that the protocol server returns is implementation-specific. Errors that are directly returned by the protocol server are implementation-specific. LockAndCoauthRelatedErrorCodeTypes is defined in section 2.2.5.8, and generic error code types are defined in section 2.2.5.6. For other unknown error types, the protocol server returns an error code value set to "LockRequestFail".