diff --git a/.changeset/mighty-ants-whisper.md b/.changeset/mighty-ants-whisper.md new file mode 100644 index 000000000..d639aa6c3 --- /dev/null +++ b/.changeset/mighty-ants-whisper.md @@ -0,0 +1,5 @@ +--- +"@livekit/protocol": patch +--- + +add missing proto import diff --git a/livekit/livekit_models.pb.go b/livekit/livekit_models.pb.go index 0206f34c2..4ad86a384 100644 --- a/livekit/livekit_models.pb.go +++ b/livekit/livekit_models.pb.go @@ -5819,7 +5819,7 @@ const file_livekit_models_proto_rawDesc = "" + "\x13can_update_metadata\x18\n" + " \x01(\bR\x11canUpdateMetadata\x12\x18\n" + "\x05agent\x18\v \x01(\bB\x02\x18\x01R\x05agent\x122\n" + - "\x15can_subscribe_metrics\x18\f \x01(\bR\x13canSubscribeMetrics\"\xd7\b\n" + + "\x15can_subscribe_metrics\x18\f \x01(\bR\x13canSubscribeMetrics\"\xb5\b\n" + "\x0fParticipantInfo\x12\x10\n" + "\x03sid\x18\x01 \x01(\tR\x03sid\x12\x1a\n" + "\bidentity\x18\x02 \x01(\tR\bidentity\x124\n" + @@ -5828,8 +5828,8 @@ const file_livekit_models_proto_rawDesc = "" + "\bmetadata\x18\x05 \x01(\tB&\x88\xb5\x18\x01\x92\xb5\x18\x1eR\bmetadata\x12\x1b\n" + "\tjoined_at\x18\x06 \x01(\x03R\bjoinedAt\x12 \n" + "\fjoined_at_ms\x18\x11 \x01(\x03R\n" + - "joinedAtMs\x12:\n" + - "\x04name\x18\t \x01(\tB&\x88\xb5\x18\x01\x92\xb5\x18\x1eR\x04name\x12\x18\n" + + "joinedAtMs\x12\x18\n" + + "\x04name\x18\t \x01(\tB\x04\x88\xb5\x18\x01R\x04name\x12\x18\n" + "\aversion\x18\n" + " \x01(\rR\aversion\x12>\n" + "\n" + diff --git a/protobufs/livekit_models.proto b/protobufs/livekit_models.proto index 63c143080..619dbf7f4 100644 --- a/protobufs/livekit_models.proto +++ b/protobufs/livekit_models.proto @@ -174,10 +174,7 @@ message ParticipantInfo { int64 joined_at = 6; // timestamp when participant joined room, in milliseconds int64 joined_at_ms = 17; - string name = 9 [ - (logger.redact) = true, - (logger.redact_format) = "" - ]; + string name = 9 [(logger.redact) = true]; uint32 version = 10; ParticipantPermission permission = 11; string region = 12; @@ -233,9 +230,7 @@ message SimulcastCodecInfo { message TrackInfo { string sid = 1; TrackType type = 2; - string name = 3 [ - (logger.redact) = true - ]; + string name = 3 [(logger.redact) = true]; bool muted = 4; // original width of video (unset for audio) // clients may receive a lower resolution version with simulcast diff --git a/rpc/typed_api_test.go b/rpc/typed_api_test.go index 9d4a666d9..6a74db711 100644 --- a/rpc/typed_api_test.go +++ b/rpc/typed_api_test.go @@ -32,9 +32,9 @@ func TestMiddleware(t *testing.T) { } for _, c := range cases { - var o psrpc.ClientOpts - c.opt(&o) t.Run(c.label, func(t *testing.T) { + var o psrpc.ClientOpts + c.opt(&o) for _, c := range o.RpcInterceptors { ch := make(chan []psrpc.RequestOption, 1) call := c(psrpc.RPCInfo{}, func(ctx context.Context, req proto.Message, opts ...psrpc.RequestOption) (proto.Message, error) { @@ -45,7 +45,7 @@ func TestMiddleware(t *testing.T) { expected := []psrpc.RequestOption{func(*psrpc.RequestOpts) {}, func(*psrpc.RequestOpts) {}} go call(context.Background(), nil, expected...) - eqPtr := func(a psrpc.RequestOption) func(a psrpc.RequestOption) bool { + eqPtr := func(a psrpc.RequestOption) func(psrpc.RequestOption) bool { return func(b psrpc.RequestOption) bool { return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer() } diff --git a/utils/math.go b/utils/math.go index 240901014..90caff0a1 100644 --- a/utils/math.go +++ b/utils/math.go @@ -33,8 +33,5 @@ func FastLogisticFunc(x0, L, k float64) func(x float64) float64 { } func Abs[T constraints.Signed | constraints.Float](v T) T { - if v < 0 { - return -v - } - return v + return max(v, -v) }