Repository navigation
Open
Labels
enhancementNew feature requestNew feature requestintegrationCompatibility with other apps/systemsCompatibility with other apps/systems
Description
Opening, editing and saving work. Save As, PDF form submit, convert-and-edit, review and comment-only modes, UI language and save-type versioning don't. Below, the gaps are ordered by what breaks for users first. Part of #11; the baseline is feat/wopi-phase-5 (#8) at 64a993f, compared against the Euro-Office server at d1936a04.
The plan covers only what EO actually reads or calls. Collabora-only features, and MS-WOPI features EO never calls, are out of scope here.
Phase 1: EO calls that fail today
- PutRelativeFile with
X-WOPI-SuggestedTarget. EO uses it for Save As, download-as-save, PDF form submit and convert-and-edit; the host answers 501. EO sends only SuggestedTarget (extension-only or full name), plusX-WOPI-FileConversion: truefor convert-and-edit. It reads onlyHostEditUrlfrom the response (convert-and-edit navigates to it); for Save As it only checks that the call succeeded. Once this lands,UserCanNotWriteRelativecan go tofalse. -
X-WOPI-MaxExpectedSize→ 412 on GetFile. EO sends it on every GetFile (default 500 MB,FileConverter.converter.maxDownloadBytes); the host ignores it. - UI language. The host strips every
<…>placeholder fromurlsrcand appends onlywopisrcandaccess_token. EO readslangoruifor the editor language and the new-file template locale, so it looks like every user gets EO's default. Substituteui/rsfrom the user's Nextcloud language. Theme (thm) can follow; EO passes it through to the page but doesn't read it server-side.
Phase 2: permission modes
- Review and comment-only. EO builds its permissions from
UserCanWrite,ReadOnly,UserCanReview,SupportsReviewingandUserCanOnlyComment. The host emits onlyUserCanWrite, so a share is either full edit or read-only. This needs a decision on the Nextcloud side first: core shares have no comment or review permission, so the mapping (a share attribute? a per-share option in the sharing UI?) is the real work. The emitting part is small. - CheckFileInfo fields EO reads but the host doesn't send:
ReadOnly(clears edit, and with it comment and fill-forms)FileExtension(overrides the extension fromBaseFileName)FileNameMaxLength(EO truncates rename requests to it; default 255)HidePrintOption(EO ORs it withDisablePrint)CopyPasteRestrictions(CurrentDocumentOnly/BlockAll; EO doesn't readDisableCopy)BreadcrumbDocName(EO prefers it overBaseFileNameas the title)
Phase 3: save semantics
- Save-type headers. EO sends
X-LOOL-WOPI-IsModifiedByUser,X-LOOL-WOPI-IsAutosaveandX-LOOL-WOPI-IsExitSave(theX-LOOL-prefix, notX-COOL-), and going by the code only with the valuetrue: in the run, a false flag arrived as a missing header. A timed save carriesIsAutosaveandIsModifiedByUser; the save when the last user leaves carriesIsExitSaveandIsModifiedByUser. Reading both prefixes (absent = false) should let the host create versions on exit saves rather than on every PutFile. - Attribute saves to the editing user. EO sends the last editor's user id in
X-WOPI-Editorson each PutFile; the host ignores it. Using it would put the right user on the version and in activity. - External change during a session. The host's WOPI lock is advisory (its own table), so a WebDAV PUT during an editing session succeeds and this can happen in normal use. On an
X-LOOL-WOPI-Timestampmismatch the host currently saves EO's content and logs a warning; the external version survives in the file's versions. That stopgap is right for now: answering 409 instead made EO show a generic save error, and in that run no further save arrived during the session and the exit save failed with the same stale timestamp, so the edits didn't reach Nextcloud. A conflict copy (write EO's content to a new file and keep the external change in place) would keep both versions in plain sight.
Phase 4: Nextcloud integration
- New files from templates. The app registers no template creator or provider. EO honours
TemplateSource: it fetches the template, then force-saves the content into the target. That gives "new from template" without the host writing the content itself. - Previews and conversion. EO exposes Collabora-compatible
/cool/convert-to/:formatand/lool/convert-to/:format. A preview provider and a conversion or TaskProcessing provider can use them. - Editor capabilities. EO serves
/hosting/capabilities(product version,hasTemplateSource,hasMobileSupport, convert-to endpoint), linked from discovery. Fetching it gives version detection and feature gating; exposing the result through an OCS capabilities provider would let clients see it. - Mobile. EO advertises
mobileView/mobileEditactions (?mobile=1). The host never picks them, and there is no DirectEditing provider for the mobile apps. - PDF forms. EO advertises a
formsubmitaction for fillable forms; submit is a PutRelativeFile, so this follows Phase 1. - Admin settings. Per-group enable/edit restrictions.
Small conformance items
- Read-only users get the
editurlsrc. In the run EO fell back to view mode without sending LOCK (separate document key) and logged a warning, so nothing breaks; picking theviewaction would avoid relying on that fallback. - An unknown access token returns 403; MS-WOPI expects 401. EO doesn't distinguish (it logs the status only), so this is for other WOPI clients and the validator.
- Discovery: EO emits a single net-zone whose name is configurable (
wopi.wopiZone, defaultexternal-http). The host takes the first match across zones; fine for EO, but worth a zone preference before other clients are supported.
Where this sits in the code
Host, at 64a993f:
- PutRelativeFile falls to the default branch → 501:
WopiController.php#L363 - Placeholder stripping:
DiscoveryService.php#L292-L295 editurlsrc first,viewas fallback:EditorController.php#L66-L67- Unknown token → 403:
WopiController.php#L72-L74 - Action lookup, first match across net-zones:
DiscoveryService.php#L139-L141 - Share links use the same
edit/viewlookup, so nomobileView/mobileEdit:ShareController.php#L119-L120 - App registration, no template creator or provider registered:
Application.php#L28 - Timestamp handling, COOL 409 vs EO save-and-warn:
WopiController.php#L262-L271
Euro-Office server, at d1936a04:
- PutFile headers (
X-WOPI-Editors,X-LOOL-WOPI-*):wopiClient.js#L829-L838 - PutRelativeFile:
wopiClient.js#L859-L904 - PutFile errors are only logged:
wopiClient.js#L850-L853 maxDownloadBytesdefault (500 MB):default.json#L545- Permissions from CheckFileInfo:
DocsCoServer.js#L2613-L2632 X-WOPI-MaxExpectedSizeon GetFile:wopiUtils.js#L117-L119- Language from
lang/ui:wopiClient.js#L670-L671 - Capabilities:
wopiClient.js#L329-L351
Repro (office at 64a993f, Euro-Office documentserver:latest-dev with WOPI_ENABLED=true, autoAssembly at 1 min, WOPI request headers logged at the host):
- Save-type headers: open a document, type, wait for a timed save, close.
- External change: open a document, type, overwrite the file over WebDAV (the PUT succeeds), type, wait for a timed save, close. Then the same with the host patched to answer 409 on an
X-LOOL-WOPI-Timestampmismatch. - Read-only fallback: open the document through a read-only share and through a read-only public link; no LOCK arrives.
The other items come from reading the code at these commits; corrections welcome.
Metadata
Metadata
Assignees
Labels
enhancementNew feature requestNew feature requestintegrationCompatibility with other apps/systemsCompatibility with other apps/systems
Activity