aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-24 09:03:06 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-24 16:45:38 +0200
commitffdb70784f11de0df8162cea5e9f5abfac91ea96 (patch)
tree70d7577aaef5e4b5b493444bb8d1d81d8e416ce0 /docs
parentfd620dc2b61b5ef6fe72581321f488ebf8faf746 (diff)
downloadmeshbay-ffdb70784f11de0df8162cea5e9f5abfac91ea96.tar.gz
refactor(node): move file browsing and folder/file ops out of webrtc_server
FilesMixin in transport/webrtc/files.py; the blocking disk helpers join _locate in webrtc/disk.py, and the lease states go to webrtc/limits.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/MESHBAY_NODE_PROTOCOL.md4
-rw-r--r--docs/transfers-v1.md8
2 files changed, 6 insertions, 6 deletions
diff --git a/docs/MESHBAY_NODE_PROTOCOL.md b/docs/MESHBAY_NODE_PROTOCOL.md
index f9ddc72..1d1afd8 100644
--- a/docs/MESHBAY_NODE_PROTOCOL.md
+++ b/docs/MESHBAY_NODE_PROTOCOL.md
@@ -2293,8 +2293,8 @@ LP(x) = uint32be(len(x)) || x every field, no exceptions
| `MAX_LINK_INVITES_PER_GROUP` | 20 unredeemed invitation links | `roster.py` |
| `PRE_HANDSHAKE_MAX_MSG` / `MAX_MSG` | 64 KiB / 64 MiB | `webrtc_server.py` / `webrtc/limits.py` |
| `CHUNK_SIZE` | 1 MiB | `webrtc/limits.py` |
-| `DOWNLOAD_BUFFER_HIGH` | 2 MiB | `webrtc_server.py` |
-| `MAX_UPLOAD_BYTES` | 8 GiB, default only — `max_upload_gb` overrides it per node | ” |
+| `DOWNLOAD_BUFFER_HIGH` | 2 MiB | `webrtc/files.py` |
+| `MAX_UPLOAD_BYTES` | 8 GiB, default only — `max_upload_gb` overrides it per node | `webrtc_server.py` |
| Download pipeline / chunk retry (client) | 8 in flight; 6 attempts, 1.5 s apart | `file-utils.js` |
| Upload chunk / window / send-buffer high water (client) | 48 KiB / 32 / 1 MiB | `transport.js` |
| `UPLOAD_ID_LEN` | 16 bytes, hex on the wire | `protocol.py` |
diff --git a/docs/transfers-v1.md b/docs/transfers-v1.md
index 13e4869..711c861 100644
--- a/docs/transfers-v1.md
+++ b/docs/transfers-v1.md
@@ -52,9 +52,9 @@ naturally make are false here.
**A download is invisible to the node.** `pipelinedDownload`
(`static/file-utils.js`) sends `PIPELINE_WINDOW = 8` independent `file_req`
messages and reassembles the answers. Each one is served by
-`_do_file_request` (`webrtc_server.py:3380`), which looks the entry up, reads
+`_do_file_request` (`webrtc/files.py`), which looks the entry up, reads
and encrypts one 1 MB chunk, waits for room on the channel
-(`DOWNLOAD_BUFFER_HIGH`, `webrtc_server.py:253`) and sends it. **The node never
+(`DOWNLOAD_BUFFER_HIGH`, `webrtc/files.py`) and sends it. **The node never
learns that a download started, and never learns that one ended.** There is
nothing to count and nothing to cap. This is the central fact of this work.
@@ -114,7 +114,7 @@ Worth stating, because each of these is a plausible first attempt.
**push** the grant.
5. **Gating every `file_req`.** Thumbnails, posters, cover art and audio
transcodes are served through the *same* `file_req` path
- (`_try_serve_thumbnail`, `webrtc_server.py:3353`), and so are image and text
+ (`_try_serve_thumbnail`, `webrtc/files.py`), and so are image and text
previews. Requiring a slot for all of them means opening a poster grid
queues behind a film. §4.4 handles this.
6. **Holding a slot while paused.** If pausing keeps the slot, one member can
@@ -236,7 +236,7 @@ function asked:
| What | Call site | Resolves to | Rule |
|---|---|---|---|
-| Thumbnails, TMDB posters, cover art, cached audio transcodes | `MediaThumb` (`video-app.js:204`), and the Music/Photos grids through it | a **media-cache id**, not an index entry — `_try_serve_thumbnail`, `webrtc_server.py:3353` | **Never leased, never counted, never queued.** One chunk each, out of a bounded cache the node built itself |
+| Thumbnails, TMDB posters, cover art, cached audio transcodes | `MediaThumb` (`video-app.js:204`), and the Music/Photos grids through it | a **media-cache id**, not an index entry — `_try_serve_thumbnail`, `webrtc/files.py` | **Never leased, never counted, never queued.** One chunk each, out of a bounded cache the node built itself |
| Looking at one file — a photo opened full size, a PDF, an image, a text file | `PhotoViewer` (`photos-app.js:171`), the Files preview modal (`files-app.js:610`) | a real index entry, fetched whole | **Not leased.** Bounded by §3.4.1 below, which no real viewer ever reaches |
| Downloading, and uploading | `downloadEntry`, `downloadDirectory` (`file-utils.js`), `uploadFile` (`transport.js:2192`) | a real index entry | **Leased.** These are exactly the three call sites that go through `transfers.start()` — the three that produce a row in the transfers widget |