Skip to content

fix(wopi): report a locked file as 423, not 500 - #6054

Merged
elzody merged 1 commit into
mainfrom
fix/putfile-locked-status-code
Sep 9, 2026
Merged

fix(wopi): report a locked file as 423, not 500#6054
elzody merged 1 commit into
mainfrom
fix/putfile-locked-status-code

Conversation

@timar

@timar timar commented Sep 8, 2026

Copy link
Copy Markdown
Member

When putContent() throws LockedException the file is locked by another operation and we have written nothing. Answering 500 says the server is broken, which it isn't, and it buries a routine, self-resolving condition in the error logs.

It also misleads the editor. Collabora Online cannot tell a genuine fault from a refusal, so after the failed upload it asks for CheckFileInfo to work out whether the document in storage is still the one it knows. A 423 lets it see the upload for what it was and retry once the lock clears.

423 is what this controller already answers with when the lock manager reports a file locked in lock() and refreshLock(); use it on the write path too.

Do not use 409: in WOPI that means the document changed in storage, and Collabora Online reads it that way. It would put a conflict dialog in front of the user, asking them to discard their work or overwrite a file that nobody has touched.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

When putContent() throws LockedException the file is locked by another
operation and we have written nothing. Answering 500 says the server is
broken, which it isn't, and it buries a routine, self-resolving
condition in the error logs.

It also misleads the editor. Collabora Online cannot tell a genuine
fault from a refusal, so after the failed upload it asks for
CheckFileInfo to work out whether the document in storage is still the
one it knows. A 423 lets it see the upload for what it was and retry
once the lock clears.

423 is what this controller already answers with when the lock manager
reports a file locked in lock() and refreshLock(); use it on the write
path too.

Do not use 409: in WOPI that means the document changed in storage, and
Collabora Online reads it that way. It would put a conflict dialog in
front of the user, asking them to discard their work or overwrite a file
that nobody has touched.

Signed-off-by: Andras Timar <andras.timar@collabora.com>

@elzody elzody left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Thanks a lot for cleaning this up! 馃挏

@elzody

elzody commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable35

@elzody

elzody commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable34

@elzody

elzody commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable33

@elzody

elzody commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants