Skip to content

iOS: send and download files too large for one message - #120

Merged
larrydewey merged 1 commit into
masterfrom
feat/large-files-ios
Nov 29, 2026
Merged

larrydewey merged 1 commit into
masterfrom
feat/large-files-ios

Conversation

@larrydewey

Copy link
Copy Markdown
Owner

iOS's part of Appendix U phase 1 (replaces #119, which closed when its base branch went with #118).

Store (IosLargeFiles, set on the main node before it listens): size via mediaSize, readAt via readMediaRange for sealed files (plain ones by seek and read), reserve makes an empty 0600 file in the media folder, freeSpace from volumeAvailableCapacityForImportantUsage.

Sending. In a chat with one contact, from the main identity, a picked file over the message limit is copied into the media folder, sealed a chunk at a time (sealMediaFile). Unlike Android's persisted SAF permission, a picked iOS URL can't be counted on to stay readable for the 30 days a file is served. It is then offered with sendFileAt. Its thumbnail comes from the picked file: ImageIO for photos, AVAssetImageGenerator for videos. A photo-library pick that size is kept from the picker's bytes. Groups, notes and anonymous identities still refuse files over the limit.

Receiving. Offers (an @Observable, in the environment) holds each offer's TransferState and thumbnail; FileContent shows the thumbnail and Tap to download (size) / progress / retry. TransferChanged updates the bubble in place, Done reloads the chat. FileOffered notifies like a file.

Not run yet. This Linux machine can't build iOS. CI's iOS job compiles it; it needs a run on the Mac: a large file each way with a phone or the desktop, including a video's thumbnail, cancel, and a download after the app restarts.

The main node gets a large-file store before it listens: sealed copies
in the media folder, read a range at a time, a reserved file for each
download, and the free space.

A file picked in a chat with one contact over the message limit is
copied and sealed a chunk at a time into the media folder (a picked file
may not stay readable for the 30 days it is served) and offered from
there, with a thumbnail made from the picked file: ImageIO for photos,
AVAssetImageGenerator for videos. A large photo from the library is kept
from the picker's bytes.

Offered files show their thumbnail and how the download stands; a tap
starts, cancels or retries it, progress updates the bubble in place, and
the chat reloads once the file is here. Offers notify like files.
@larrydewey
larrydewey marked this pull request as ready for review November 29, 2026 15:23
@larrydewey
larrydewey merged commit 299ca2f into master Nov 29, 2026
8 checks passed
@larrydewey
larrydewey deleted the feat/large-files-ios branch November 29, 2026 16:52
@larrydewey larrydewey mentioned this pull request Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant