Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 14, 2025

Description

This PR updates outdated references from LOOL (LibreOffice Online) to COOL (Collabora Online) following the naming convention change that occurred in November 2021.

Changes

Main Controller (lib/Controller/WopiController.php)

  • Updated constant from LOOL_STATUS_DOC_CHANGED to COOL_STATUS_DOC_CHANGED
  • Changed HTTP header reference from X-LOOL-WOPI-Timestamp to X-COOL-WOPI-Timestamp
  • Added backward compatibility fallback to support legacy X-LOOL-WOPI-Timestamp header
  • Updated JSON response key from LOOLStatusCode to COOLStatusCode

Test File (tests/features/bootstrap/WopiContext.php)

  • Updated all test HTTP header references from X-LOOL-WOPI-Timestamp to X-COOL-WOPI-Timestamp

Backward Compatibility

The implementation maintains full backward compatibility by checking for the new X-COOL-WOPI-Timestamp header first, and falling back to the legacy X-LOOL-WOPI-Timestamp header if not present. This ensures compatibility with both current and older Collabora Online installations.

Related Issue

Fixes the outdated references mentioned in

$wopiHeaderTime = $this->request->getHeader('X-LOOL-WOPI-Timestamp');
and https://github.com/nextcloud/richdocuments/blob/main/lib/Controller/WopiController.php#L599

The naming change dates back to November 2021 when LibreOffice Online was rebranded to Collabora Online.

Original prompt

This section details on the original issue you should resolve

<issue_title>Outdated reference to X-LOOL-WOPI-Timestamp replaced with X-COOL-WOPI-Timestamp</issue_title>
<issue_description>

$wopiHeaderTime = $this->request->getHeader('X-LOOL-WOPI-Timestamp');

A simple fix would be to read X-COOL-WOPI-Timestamp header and pick whichever ever is present.
But using only X-COOL-WOPI-Timestamp should be safe without Collabora since november 2021.

The LOOLStatusCode json key name is also concerned. It should be COOLStatusCode.

https://github.com/nextcloud/richdocuments/blob/main/lib/Controller/WopiController.php#L599C1-L599C106

The naming change dates back from 2021.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #5107


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI changed the title [WIP] Fix outdated reference to X-LOOL-WOPI-Timestamp Update outdated LOOL references to COOL naming conventions Oct 14, 2025
Copilot AI requested a review from juliusknorr October 14, 2025 11:30
Copilot finished work on behalf of juliusknorr October 14, 2025 11:30
@juliusknorr juliusknorr force-pushed the copilot/fix-outdated-timestamp-reference branch from 11ad2a8 to d8a445d Compare October 22, 2025 18:27
Copilot AI and others added 2 commits October 22, 2025 20:27
- Update X-LOOL-WOPI-Timestamp header to X-COOL-WOPI-Timestamp with backward compatibility fallback
- Update LOOLStatusCode to COOLStatusCode in JSON response
- Update LOOL_STATUS_DOC_CHANGED constant to COOL_STATUS_DOC_CHANGED
- Update test files to use new X-COOL-WOPI-Timestamp header
- Maintain backward compatibility for legacy LOOL header

Co-authored-by: juliusknorr <3404133+juliusknorr@users.noreply.github.com>
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr juliusknorr force-pushed the copilot/fix-outdated-timestamp-reference branch from d8a445d to fc8af0c Compare October 22, 2025 18:27
Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Tested and document change detection still works. Also could not find other occurrences.

@juliusknorr juliusknorr marked this pull request as ready for review October 22, 2025 18:28
@juliusknorr juliusknorr requested a review from elzody as a code owner October 22, 2025 18:28
@juliusknorr juliusknorr merged commit 6c9bc6b into main Oct 28, 2025
72 of 74 checks passed
@juliusknorr juliusknorr deleted the copilot/fix-outdated-timestamp-reference branch October 28, 2025 16:15
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.

Outdated reference to X-LOOL-WOPI-Timestamp replaced with X-COOL-WOPI-Timestamp

3 participants