microsoft / Office-Online-Test-Tools-and-Documentation

Office Online test tools and documentation
https://docs.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/
MIT License
233 stars 161 forks source link

Key concepts - Inconsistent with `Lock` and `UnlockAndRelock` #441

Closed drupol closed 3 years ago

drupol commented 3 years ago

Hello,

The Key Concepts page says:

All WOPI operations that modify files, such as PutFile, will include a lock ID as a parameter in their request. Usually the ID will be passed in the X-WOPI-Lock request header (but not always; UnlockAndRelock is an exception).

However, when we check UnlockAndRelock, we can see that this is not true.

X-WOPI-Lock: A string provided by the WOPI client that the host must use to identify the new lock on the file. The maximum length of a lock ID is 1024 ASCII characters. Required.

Do you think opening a PR to fix this is a good idea?

RobRol commented 3 years ago

Howdy drupol,

I think the confusion is that the X-Wopi-Lock header on the UnlockAndRelock request is the new lock not the old lock.

On most requests the X-Wopi-Lock header contains the existing lock string that the host is expected to enforce alongside the request. The UnlockAndRelock request uses the X-WOPI-OldLock header for that string.

Best regards, Rob Rolnick

drupol commented 3 years ago

Ok ok fair enough :)

Maybe this should be copy-pasted into the documentation.

Thanks for the responsiveness. Regards.

RobRol commented 3 years ago

Howdy drupol,

That's reasonable. See the new Pull Request.

Best regards, Rob Rolnick

drupol commented 3 years ago

Thanks !