Repository navigation
Support 200 MiB Journal asset transfers - #187
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37e2f90944
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { asset = ticket.asset | ||
| ; version = ticket.version | ||
| ; maximum_plaintext_bytes = 8 * 1024 * 1024 | ||
| ; maximum_plaintext_bytes = 200 * 1024 * 1024 |
There was a problem hiding this comment.
Preserve concurrent admission for small production transfers
For ordinary journal images, this change serializes downloads regardless of their actual size. The production worker now always passes a 200 MiB limit, while fetch_asset reserves asset_wire_bytes maximum_plaintext_bytes + maximum_plaintext_bytes; with_byte_reservation consequently acquires the entire 64 MiB semaphore for every request, including tiny thumbnails. Previously, the 8 MiB limit allowed multiple downloads to overlap. The upload path also always requests the full reservation, so a background upload blocks foreground image downloads. Separate the supported file-size ceiling from transfer admission so small production transfers retain concurrent progress.
Useful? React with 👍 / 👎.
| || List.length headers <> List.length (List.sort_uniq String.compare (List.map fst headers)) | ||
| then Error "Invalid signed asset upload plan" | ||
| else ( | ||
| match perform { request with uri; headers } with |
There was a problem hiding this comment.
Extend the transport deadline for newly supported large uploads
For large uploads on typical mobile connections, the new direct PUT still uses Http_eio.perform, which initializes a fixed 30-second budget and wraps the entire request write and response wait in Eio.Time.with_timeout_exn (http_eio.ml:140). A 200 MiB plaintext upload at 10 Mbit/s needs roughly 168 seconds before encryption overhead, so it is deterministically cancelled and reported as a network failure despite being within the newly accepted size limit; retries encounter the same deadline. Use a size-aware transfer deadline or an inactivity timeout for asset bodies rather than retaining the small-request total deadline.
Useful? React with 👍 / 👎.
| let local_store | ||
| ?(asset_cache_budget_bytes = 268435456L) | ||
| ?(asset_maximum_file_bytes = 8 * 1024 * 1024) | ||
| ?(asset_maximum_file_bytes = 200 * 1024 * 1024) |
There was a problem hiding this comment.
Raise the durable upload-intent limit alongside the staging limit
For imports larger than 100 MiB and at most 200 MiB, the increased staging limit accepts and copies the file, but the production import workflow still rejects it before any upload. prepare_import_unlocked passes the staged size to Asset_upload_intent.prepare, whose validation in logseq_db_types/lib/asset_upload_intent.ml:52 still rejects size > 104857600L; the worker then releases the staged file and returns "Invalid asset upload intent". Consequently, the application's durable import/upload path cannot reach the new large-file transfer support. Update the intent validation and its checkpoint decoding path consistently with the new ceiling.
Useful? React with 👍 / 👎.
|
iOS Simulator loopback validation of PR head
Every request returned HTTP 200. Both exact-200-MiB runs performed prepare POST (115 request / 409 response bytes) → fixture HMAC-signed PUT (no bearer forwarded) → complete POST (116 / 0 bytes) → GET. Each downloaded file matched the staged plaintext size and SHA-256: Local evidence: |
Raises the Worker Put/Fetch, per-file cache, codec, Core and C/Swift AES-GCM limits to 200 MiB. Keeps the 64 MiB shared reservation for smaller transfers; larger transfers reserve it exclusively. Wire payloads over 100 MiB use Logseq prepare/direct PUT/complete without forwarding the managed bearer token to the signed URL.
Host: full source build passed; the codec accepted exactly 200 MiB and rejected +1 byte; reservation regressions passed. macOS native crypto decoded upstream fixtures up to 8 MiB and rejected 200 MiB + 1; the adapter fixture stopped before network in key setup.
iOS Simulator: final HEAD built, installed and launched on a fresh iPhone 17 Pro / iOS 26.1. Experimental host-restamp; no full iOS ABI claim. This is launch evidence, not UI transfer acceptance. The production app fixes its sync origin and auth provider, so no loopback transfers were exercised under the no-new-harness constraint. No real device, personal graph, or production upload was used. Keep draft until full-size transfer verification.