fix(slice-1): F6 — drop dead Channel.created_at field
Adversarial review F6 (Low, confirmed): Channel.created_at: Instant was
drafted 'for the idle timeout' (spec §5.1) but the timer keys off
RtcSession.last_rtp_rx (and now last_rtp_rx after F4), never creation
time. The field was never read; the Instant import it pulled is dropped
with it.
Spec §5.1 already reconciled in 8680f2b (struct sketch + comment).
Spec §4.5 already specified 'no RTP' (60 s); the contradiction with
the old 5-min lineage is closed.
Refactor phase — full test suite + clippy green; no behavior change.
This commit is contained in:
@@ -47,7 +47,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
use std::time::Instant;
|
||||
use uuid::Uuid;
|
||||
|
||||
/// Newtype wrapping a `Uuid` for the channel id.
|
||||
@@ -127,17 +126,17 @@ pub enum Direction {
|
||||
/// - `media: Option<MediaLeg>` — second consumer.
|
||||
/// - `audiohooks: Vec<AudiohookHandle>` — escalation rung 2.
|
||||
/// - `tap: Option<TapHandle>` — step 2.
|
||||
///
|
||||
/// (F6 review patch: an earlier sketch carried `created_at: Instant` "for
|
||||
/// the idle timeout," but the timer keys off `RtcSession.last_rtp_rx`, not
|
||||
/// creation time. The field was dead; the work-pool would have populated
|
||||
/// it on every `new_inbound` and never read it. Dropped along with its
|
||||
/// `Instant` import.)
|
||||
#[derive(Debug)]
|
||||
pub struct Channel {
|
||||
pub id: ChannelId,
|
||||
pub state: ChannelState,
|
||||
pub direction: Direction,
|
||||
/// For the 60 s idle timeout (spec §4.5). `Instant` is a monotonic
|
||||
/// clock — choosing it over `SystemTime` means we're measuring
|
||||
/// elapsed wall-time within this process, NOT a calendar time the
|
||||
/// user could change mid-call. The monotonic clock is the right
|
||||
/// tool for "has this peer been silent for 60 seconds?"
|
||||
pub created_at: Instant,
|
||||
}
|
||||
|
||||
impl Channel {
|
||||
@@ -147,7 +146,6 @@ impl Channel {
|
||||
id: ChannelId::new(),
|
||||
state: ChannelState::New,
|
||||
direction: Direction::Inbound,
|
||||
created_at: Instant::now(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user