Repository navigation
feat(dvt): relax payload decode, expose launch_with_options, and grow large reads incrementally (F2) - #7
Merged
Derrors merged 2 commits intoDec 6, 2026
Conversation
… large reads incrementally
Three DVT / transport improvements (Track F2):
1. Relax DVT non-framing decode (dvt/message.rs, dvt/remote_server.rs):
- Validate DTX header magic (0x1F3D5B79) as a framing error in Message::from_reader.
- Treat NSKeyedArchive payload decode failure and unknown aux types on
well-framed messages as non-fatal (data = None while preserving raw_data;
aux = None on aux decode failure), so RemoteServerClient::spawn_reader
does not tear down the whole connection when a peer sends an opaque or
custom-archived payload.
- Expose MessageHeader::{identifier, conversation_index, expects_reply}
publicly so callers (e.g. ictl-ax) can reuse Message::from_reader
directly instead of duplicating DTX wire framing.
2. Expose ProcessControlClient::launch_with_options with structured NsErrorInfo:
- Make ProcessControlClient::launch_with_options pub (removing the xctest
feature gate) and deduplicate launch_app onto it.
- Add DvtError::LaunchFailed(Box<NsErrorInfo>) (sub_code 6) so launch
failures preserve structured domain/code/description/underlying error
fields rather than flattening them into IdeviceError::InternalError(String).
3. Incremental growing reads instead of upfront 64 MiB allocations:
- Add read_exact_growing (capped 64 KiB initial reserve + AsyncReadExt::take
+ read_to_end, truncating on UnexpectedEof) and use it in Idevice::read_raw,
Idevice::read_plist_value, and DVT Message::from_reader instead of upfront
vec![0; len] / packet_data.resize(new_total, 0).
Co-Authored-By: Claude Code <noreply@anthropic.com>
Replaced by `NsErrorInfo::from_archive_bytes` in `process_control` with no remaining callers across the workspace or downstream consumers. Co-Authored-By: Claude Code <noreply@anthropic.com>
Derrors
deleted the
feat/dvt-relax-decode-launch-options-growing-reads
branch
December 6, 2026 10:39
8 of 9 tasks
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.
Summary
Three focused DVT & framing improvements for downstream
iphone-control(Track F2):Relax non-framing DVT decode & expose header getters (
idevice/src/services/dvt/message.rs,remote_server.rs):header.magic == 0x1F3D_5B79as a framing error inMessage::from_reader.ns_keyed_archive::decode::from_bytes, returnOk(Message)withdata: Noneandraw_data: Some(bytes)(logging viatracing::debug!) instead of tearing downRemoteServerClient's reader loop; likewise yieldaux: NonewhenAux::from_bytesrejects an unknown aux type on a well-framed aux slice.MessageHeader::{identifier, conversation_index, expects_reply}aspubso downstream DTX readers (ictl-ax/src/dtx.rs) can delegate wire framing directly toMessage::from_reader.Public
ProcessControlClient::launch_with_optionswith structuredNsErrorInfo(idevice/src/services/dvt/process_control.rs,errors.rs):#[cfg(feature = "xctest")]and makeProcessControlClient::launch_with_optionspub; deduplicatelaunch_appontolaunch_with_options.DvtError::LaunchFailed(Box<NsErrorInfo>)(sub_code = 6, displaying viaNsErrorInfo::fmt), decodingraw_datafirst viaNsErrorInfo::from_archive_bytes(withNsErrorInfo::from_plistfallback), so callers can inspectinfo.code/info.domain/info.localized_descriptionwithout hand-rollingprocesscontrolinvocations.Incremental growing reads instead of upfront 64 MiB allocations (
idevice/src/lib.rs,idevice/src/services/dvt/message.rs):read_exact_growing(initial reserve capped at 64 KiB +AsyncReadExt::take(len).read_to_end, truncating and returningUnexpectedEofon short reads) and replace upfrontvec![0; len]/packet_data.resize(new_total, 0)inIdevice::read_raw,Idevice::read_plist_value, andMessage::from_reader.Tests Added (+8)
lib.rs:read_exact_growing_reads_exact_and_avoids_upfront_alloc_on_truncated_frame,read_plist_value_truncation_fails_with_unexpected_eofdvt/message.rs:dvt_from_reader_preserves_raw_data_when_ns_keyed_archive_decode_fails,dvt_from_reader_rejects_bad_magic_and_enforces_total_limit_incrementally,dvt_from_reader_survives_unknown_aux_type_on_well_framed_messagedvt/remote_server.rs:reader_survives_undecodable_payload_and_continues_delivering_messages,reader_closes_connection_on_framing_errordvt/process_control.rs:launch_with_options_returns_pid_and_structured_ns_errorVerification
cargo fmt --all -- --check: passcargo test -p idevice --no-default-features --features "ring,dvt" --lib: 25 passed / 0 failedcargo test -p idevice(with fulliphone-controlfeature set): 80 passed / 0 failed (+8)cargo clippy -p idevice --no-default-features --features "ring,full" --all-targets -- -D warnings: passcargo clippy -p idevice-tools --all-targets -- -D warnings: passcargo check(ring,fullandring,dvt): passpython3 -m unittest discover -s scripts: 5/5 passedpython3 scripts/release.py validate: pass🤖 Generated with Claude Code