mirror of
https://github.com/livekit/livekit.git
synced 2026-12-04 04:48:11 +00:00
When a WHIP PATCH carries an If-Match that no longer matches the publisher's ICE session, the RTC node returns psrpc.FailedPrecondition, but iceTrickle had no case for that code and answered 500. RFC 9725 section 4.3.1 requires 412 Precondition Failed, which is also what psrpc's own ErrorCode.ToHTTP maps FailedPrecondition to. Also pass the error instead of nil to handleError in the non-psrpc branches of iceTrickle and iceRestart. handleError calls err.Error(), so a nil error would panic. The psrpc client wraps all of its own failures today, so this is hardening. Add a unit test for the PATCH status mapping and an integration test that drives a real WHIP session through trickle and ICE restart.