18.104.22.168.2 Release Lock
If the SchemaLockRequestType attribute is set to "ReleaseLock", the protocol server considers this schema lock subrequest to be of type, "Release lock". The protocol server processes the request to exit the coauthoring session and checks the number of clients editing the document at that instant in time. When the protocol server receives a schema lock subrequest of type "ReleaseLock" from the last and only client editing the document, the protocol server does both of the following:
Delete the client identifier entry associated with the client in the file coauthoring tracker. The file coauthoring tracker is defined in section 3.1.1.
Delete the coauthoring session and the shared lock on the file if the client that sent the subrequest of type "Release lock" is the last client in the file coauthoring tracker.
If the current client is not already present in the coauthoring session, the protocol server does one of the following:
Return an error code of "InvalidCoauthSession" if there are other clients present in the coauthoring session.<35>
Return "Success" if no clients are present in the coauthoring session.
The protocol server SHOULD<36> return an error code of "FileAlreadyLockedOnServer" if there is a current exclusive lock on the file or if there is a shared lock on the file with a different schema lock identifier.
If the coauthoring session has already been deleted, the protocol server returns an error code value set to "Success" as defined in section 22.214.171.124.
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. LockCoauthRelatedErrorCodeTypes is defined in section 126.96.36.199, and generic error code types are defined in section 188.8.131.52. For other unknown error types, the protocol server returns an error code value set to "LockRequestFail".