Repository navigation
Conversation
Tiny Code Reviewthe AI provider rate-limited the request This is advice, not a gate. Re-run with the |
unRekable
left a comment
There was a problem hiding this comment.
Code Review
🟢 No findings.
The change moves Google Messages file sends onto the repository's standard upload pipeline: files stream in 32 KiB chunks into the existing AES-256-GCM seal format (byte-identical for one file, fresh nonce and last-flag AAD per chunk), upload, then one RPC names every part, with the 100 MB and 10-file caps enforced where the rest of chatd enforces them and cancel wired through the shared Upload. The design holds: no plaintext is fully buffered, the process boundaries are untouched, the added CancelSend arm matches the upload module's documented contract, and the encoder, chunked seal, multi-file send, over-limit refusal and cancel are all tested. The one real unknown is the phone side of the repeated-field wire layout, which no live account has seen.
Residual risk
- The several-files layout (repeated field 10) has never been sent to a real Google Messages phone; the proof and tests validate tinyclient's own encoder only. If the phone renders one file or refuses the send, that surfaces in production and the rollback is reverting this PR.
- If one file of several fails after earlier files uploaded, the already-uploaded parts stay on Google's storage with no cleanup call, and a retry re-uploads everything.
- A send holds the whole sealed file (up to about 100 MB of ciphertext) in memory while bugle uploads it. That is still better than the base, which held the plaintext too, but it is the one unbounded allocation left on this path.
b53f111 to
112f1b7
Compare
What changed and why
Google Messages can send up to ten files in one message. The phone is asked once, progress is reported, and the send can be cancelled before that ask. There is no warning that a photo will leave as an MMS copy, because the published conversation layout has no SMS, MMS, or RCS field.
Tested with
cargo test -p chatd --no-default-featuresfor the new three-file send (including cancel) and the existing one-file send, and withcargo clippy -p chatd --no-default-features --all-targets. A live Google account was not tested.Type
Platforms
Proof
Scenario: e2e/scenarios/messages-several-files
Lab run:
Compatibility
No protocol change. Each file is still capped at 100 MB. An older client keeps sending one file.
Risk and rollback
A file that fails to seal or upload is named, and the phone is not asked to send the message. Revert this change to go back to one file at a time.
Release note
Google Messages can send up to ten files in one message.
Closes #689