feat(wopi): point WopiFileSource at collab WOPI host endpoints + client-push save#100
Merged
Merged
Conversation
…nt-push save
Rework Mode 2 (WOPI) to consume the collab server's WOPI host contract
directly — the same one Casual Sheets already uses — instead of the legacy
Go gateway's embed-proxy routes:
- open() -> GET /wopi/files/:id/contents (was /api/docs/{id}/download);
item version read from X-WOPI-ItemVersion (was ETag).
- save() -> POST /wopi/files/:id/contents with X-WOPI-ItemVersion If-Match;
previously threw. This is the client-push snapshot model the
autosave hook already drives. A 409 surfaces as the new
WopiSaveConflictError (exported).
- list() -> enriches the single embedded entry via CheckFileInfo
(GET /wopi/files/:id) for the authoritative name + size.
The JWT still rides as ?access_token=; collab verifies file_id == :id and
the per-route read/write permission. Boot/probe (extractWopiContext,
/doc/{id}?access_token=) is unchanged. rename()/delete() still throw — the
host owns the file lifecycle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Reworks the editor's Mode 2 (WOPI)
WopiFileSourceto talk directly to the collab server's WOPI host endpoints — the contract Casual Sheets already uses — instead of the legacy Go gateway's embed-proxy routes. This unblocks the WOPI half of the Go→collab cutover.Endpoint changes
GET /api/docs/{id}/downloadGET /wopi/files/:id/contentsETagheaderX-WOPI-ItemVersionheaderWopiNotSupportedErrorPOST /wopi/files/:id/contents+X-WOPI-ItemVersionIf-MatchGET /wopi/files/:id(CheckFileInfo)save()is now the client-push snapshot the autosave hook already drives. A host-side version conflict (collab 409) surfaces as the new exportedWopiSaveConflictError(withexpected/actual). The JWT still rides as?access_token=; collab enforcesfile_id == :idand per-route read/write. Boot/probe (extractWopiContext,/doc/{id}?access_token=) is unchanged;rename()/delete()still throw since the host owns lifecycle.Verified: typecheck, lint (0 errors), 57 file-source unit tests (WOPI contract incl. PutFile If-Match + 409 conflict), and build all pass locally.