Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a local WebDAV server command that exposes RETYC datarooms as a mountable filesystem, and extends the service layer to support WebDAV-oriented streaming uploads/downloads and richer node metadata.
Changes:
- Add
retyc webdav servecommand with a WebDAV filesystem implementation, caching, and streaming upload/download behavior. - Extend dataroom listing/session APIs to expose MIME type + version/chunk metadata and allow reusing resolved crypto sessions.
- Refactor chunk transfer utilities to support
io.Readeruploads and streaming (io.Writer) downloads, with expanded tests.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
internal/service/types.go |
Extends DataroomNodeInfo with MIME type and version/chunk metadata for WebDAV usage. |
internal/service/dataroom.go |
Exposes reusable dataroom crypto session, factors listing logic, and adds stream-upload initialization helper. |
internal/service/chunks.go |
Changes upload to io.Reader, adds StreamDownloadChunks with bounded buffering, refactors file download to use streaming. |
internal/service/chunks_test.go |
Adds tests for reader-based uploads and streaming download ordering/error/edge cases. |
cmd/webdav.go |
Adds the WebDAV server command and filesystem implementation (listing, stat, read/seek, write, mkdir/rm/rename). |
cmd/webdav_test.go |
Adds unit tests for key WebDAV helpers (path parsing, caching, stream write handle). |
go.mod |
Adds golang.org/x/net (WebDAV) and bumps several x/* dependencies. |
go.sum |
Updates sums for the new/updated x/* module versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
145
to
+152
| concurrency := DownloadConcurrency | ||
| if chunkCount < concurrency { | ||
| concurrency = chunkCount | ||
| } | ||
| if concurrency < 1 { | ||
| // Nothing to download (empty file, or a malformed negative chunkCount). | ||
| return nil | ||
| } |
Comment on lines
+429
to
+437
| // A zero-byte buffered write is almost always a WebDAV LOCK creating a | ||
| // lock-null resource (macOS Finder, MS Office) rather than a real upload. | ||
| // Genuine empty-file PUTs carry Content-Length: 0 and take the streaming path, | ||
| // so skipping the upload here avoids creating a phantom empty node. | ||
| if fi, statErr := os.Stat(h.tempFilePath); statErr == nil && fi.Size() == 0 { | ||
| _ = os.RemoveAll(h.tempDir) | ||
|
|
||
| return nil | ||
| } |
Comment on lines
+1068
to
+1073
| var shutdownOnce sync.Once | ||
| shutdown := func() { | ||
| shutdownOnce.Do(func() { | ||
| cancel() | ||
| _ = srv.Shutdown(context.Background()) | ||
| }) |
Required by the WebDAV server + bumps the transitively-pulled x/sys, x/term, x/crypto, and x/text.
- UploadChunks / StreamDownloadChunks operate on io.Reader / io.Writer with bounded-memory concurrent transfer (windowed reorder buffer, empty/negative chunk-count guard). - Per-dataroom session, listing, and streaming-upload helpers (GetDataroomSession, ListNodesWithSession, InitStreamUpload), with ListNodes de-duplicated onto shared fetch/decrypt helpers and path errors wrapped as os.ErrNotExist. - DataroomNodeInfo carries the decrypted MIME type, version ID, and chunk count needed for direct downloads.
We can add other stuff in root
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.
No description provided.