Skip to content

Navigation Menu

Sign in
Sign up

refactor(wopi): postFile override handling into helpers and streamline logic - #5621

Open
joshtrichards wants to merge 4 commits into
main from
jtr/refactor-wopi-postFile
Open

refactor(wopi): postFile override handling into helpers and streamline logic #5621
joshtrichards wants to merge 4 commits into
main from
jtr/refactor-wopi-postFile

Conversation

@joshtrichards

@joshtrichards joshtrichards commented May 1, 2026
edited
Loading

Copy link
Copy Markdown
Member
  • Target version: main

Summary

Refactor WopiController::postFile() to make WOPI override handling easier to follow by separating the main branches into focused helper methods for:

  • RenameFile
  • PutRelativeFile
  • write-context validation

This turns postFile() into a clearer orchestrator and reduces the amount of mixed logic in the main controller method.

Notes

  • Preserves existing behavior for WOPI lock operations
  • Keeps RenameFile and PutRelativeFile paths isolated
  • Improves readability and maintainability of the shared controller flow
  • Returns HTTP_BAD_REQUEST for unsupported WOPI override values
  • Fixes the RenameFile response shape so it no longer matches PutRelativeFile

The newly introduced resolveWopiWriteContext() helper can be used for future refactoring the various other WOPI operations handling paths in this class, eliminating a lot of boilerplate/duplication.

TODO

  • Make sure nothing breaks (in theory this should be a non-eventful change externally...)
  • Double-check tests
  • Possibly add additional tests/coverage

Checklist

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

weird
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added the 3. to review Ready to be reviewed label May 1, 2026
joshtrichards marked this pull request as ready for review May 1, 2026 18:10
@joshtrichards joshtrichards changed the title (削除) refactor(wopi): postFile override handling into helpers (削除ここまで) (追記) refactor(wopi): postFile override handling into helpers and streamline logic (追記ここまで) May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@elzody elzody Awaiting requested review from elzody elzody is a code owner
@juliusknorr juliusknorr Awaiting requested review from juliusknorr juliusknorr is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /