3.7 KiB
3.7 KiB
T5.1 — PriorityMode enum + SignalMessage::SetPriorityMode
Status: Approved (with T5.1.1 follow-up for missing tests) Agent: Kimi Code CLI Started: 2026-05-12T17:00Z Completed: 2026-05-12T17:25Z Commit: c8d1239 PRD: ../PRD-video-quality-priority.md
What I changed
crates/wzp-proto/src/priority_mode.rs— New file.PriorityModeenum with four variants:AudioFirst(default),VideoFirst,ScreenShare,Balanced. DerivesDebug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize.crates/wzp-proto/src/lib.rs— Addedpub mod priority_mode;andpub use priority_mode::PriorityMode;.crates/wzp-proto/src/codec_id.rs:124-145— Added four new fields toQualityProfile:priority_mode: PriorityMode,video_bitrate_kbps: Option<u32>,video_resolution: Option<(u16, u16)>,video_fps: Option<u8>. All carry#[serde(default)]for backward compat.crates/wzp-proto/src/codec_id.rs:149-214— Updated allQualityProfileconst constructors (GOOD,DEGRADED,CATASTROPHIC,STUDIO_32K,STUDIO_48K,STUDIO_64K) to include the new fields.crates/wzp-proto/src/packet.rs:1200-1207— AddedSignalMessage::SetPriorityMode { version, mode }variant beforePictureLossIndication.crates/wzp-client/src/featherchat.rs:144-147— AddedSetPriorityModetosignal_to_call_typematch arm.crates/wzp-client/src/call.rs:639-654— Updated explicitQualityProfileconstructions to use..QualityProfile::GOODstruct-update syntax.crates/wzp-android/src/engine.rs:975-980— Same struct-update fix.crates/wzp-android/src/jni_bridge.rs:32-38— Same struct-update fix.desktop/src-tauri/src/engine.rs:77-82, 118-123— Same struct-update fix.crates/wzp-codec/src/lib.rs:73-82— Same struct-update fix.
Deviations from the task spec
Skeleton task — no numbered steps. Followed PRD-video-quality-priority.md sections "PriorityMode" and "Mid-call change".
Verification output
$ cargo test -p wzp-proto --no-fail-fast
test result: ok. 125 passed; 0 failed; 0 ignored
$ cargo test -p wzp-relay --lib --no-fail-fast
test result: ok. 99 passed; 0 failed; 0 ignored
$ cargo test -p wzp-client --lib --no-fail-fast
test result: ok. 163 passed; 0 failed; 7 ignored
$ cargo test -p wzp-codec --lib --no-fail-fast
test result: ok. 69 passed; 0 failed; 0 ignored
$ cargo test -p wzp-android --lib --no-fail-fast
test result: ok. 4 passed; 0 failed; 0 ignored
$ cargo test -p wzp-desktop --lib --no-fail-fast
test result: ok. 0 passed; 0 failed; 0 ignored
$ cargo fmt --all -- --check
# pass
$ cargo clippy -p wzp-proto --all-targets -- -D warnings
# pass
Test summary
- Tests added: 0
- Tests modified: 0
- Workspace test count: 460+ pass in affected crates
cargo clippy -p wzp-proto --all-targets -- -D warnings: passcargo fmt --all -- --check: pass
Risks / follow-ups
QualityProfileis now wider — Four new fields add 11 bytes (1 + 4 + 4 + 1 + padding). SinceQualityProfileisCopyand used in hot paths, monitor size. If it grows past 32 bytes, consider boxing optional fields.- Serde default for backward compat — Old serialized
QualityProfilewithout the new fields will deserialize correctly because all four fields have#[serde(default)]. Forward compat (new → old) is not guaranteed. SetPriorityModenot yet consumed — The signal variant is defined but no engine (client, android, desktop) handles it yet. T5.2 / T5.3 will wire the controller.
Reviewer checklist (filled in by reviewer)
- Code matches PRD intent
- Verification output is real
- No backward-incompat surprises
- Tests cover the new behavior
- Approved