chore: pin GH commits and switch to golangci-lint (#4444)
* chore: pin GH commits * switch to golangci-lint-action * fix lint issues
This commit is contained in:
@@ -97,12 +97,12 @@ func (c ClientInfo) SupportsChangeRTPSenderEncodingActive() bool {
|
||||
}
|
||||
|
||||
func (c ClientInfo) ComplyWithCodecOrderInSDPAnswer() bool {
|
||||
return !((c.isLinux() || c.isAndroid()) && c.isFirefox())
|
||||
return (!c.isLinux() && !c.isAndroid()) || !c.isFirefox()
|
||||
}
|
||||
|
||||
// Rust SDK can't decode unknown signal message (TrackSubscribed and ErrorResponse)
|
||||
func (c ClientInfo) SupportsTrackSubscribedEvent() bool {
|
||||
return !(c.ClientInfo.GetSdk() == livekit.ClientInfo_RUST && c.ClientInfo.GetProtocol() < 10)
|
||||
return c.ClientInfo.GetSdk() != livekit.ClientInfo_RUST || c.ClientInfo.GetProtocol() >= 10
|
||||
}
|
||||
|
||||
func (c ClientInfo) SupportsRequestResponse() bool {
|
||||
@@ -110,8 +110,8 @@ func (c ClientInfo) SupportsRequestResponse() bool {
|
||||
}
|
||||
|
||||
func (c ClientInfo) SupportsSctpZeroChecksum() bool {
|
||||
return !(c.ClientInfo.GetSdk() == livekit.ClientInfo_UNKNOWN ||
|
||||
(c.isGo() && c.compareVersion("2.4.0") < 0))
|
||||
return c.ClientInfo.GetSdk() != livekit.ClientInfo_UNKNOWN &&
|
||||
(!c.isGo() || c.compareVersion("2.4.0") >= 0)
|
||||
}
|
||||
|
||||
// compareVersion compares a semver against the current client SDK version
|
||||
|
||||
@@ -24,11 +24,11 @@ import (
|
||||
|
||||
func TestExtensionParticipantSid(t *testing.T) {
|
||||
longTestParticipantID := livekit.ParticipantID(make([]byte, 256))
|
||||
extParticipantSid, err := NewExtensionParticipantSid(longTestParticipantID)
|
||||
_, err := NewExtensionParticipantSid(longTestParticipantID)
|
||||
require.Error(t, err)
|
||||
|
||||
testParticipantID := livekit.ParticipantID("test")
|
||||
extParticipantSid, err = NewExtensionParticipantSid(testParticipantID)
|
||||
extParticipantSid, err := NewExtensionParticipantSid(testParticipantID)
|
||||
require.NoError(t, err)
|
||||
|
||||
expectedExt := Extension{
|
||||
|
||||
+1
-1
@@ -2302,7 +2302,7 @@ func GetOtherParticipantInfo(
|
||||
|
||||
pInfos := make([]*livekit.ParticipantInfo, 0, len(allParticipants))
|
||||
for _, op := range allParticipants {
|
||||
if !(skipSubscriberBroadcast && op.CanSkipBroadcast()) &&
|
||||
if (!skipSubscriberBroadcast || !op.CanSkipBroadcast()) &&
|
||||
!op.Hidden() &&
|
||||
op.Identity() != lpIdentity &&
|
||||
!isMigratingIn {
|
||||
|
||||
@@ -221,7 +221,7 @@ func (s *signalling) SignalSubscriptionPermissionUpdate(subscriptionPermissionUp
|
||||
}
|
||||
}
|
||||
|
||||
func (u *signalling) SignalMediaSectionsRequirement(mediaSectionsRequirement *livekit.MediaSectionsRequirement) proto.Message {
|
||||
func (s *signalling) SignalMediaSectionsRequirement(mediaSectionsRequirement *livekit.MediaSectionsRequirement) proto.Message {
|
||||
return &livekit.SignalResponse{
|
||||
Message: &livekit.SignalResponse_MediaSectionsRequirement{
|
||||
MediaSectionsRequirement: mediaSectionsRequirement,
|
||||
@@ -237,7 +237,7 @@ func (s *signalling) SignalSubscribedAudioCodecUpdate(subscribedAudioCodecUpdate
|
||||
}
|
||||
}
|
||||
|
||||
func (u *signalling) SignalPublishDataTrackResponse(publishDataTrackResponse *livekit.PublishDataTrackResponse) proto.Message {
|
||||
func (s *signalling) SignalPublishDataTrackResponse(publishDataTrackResponse *livekit.PublishDataTrackResponse) proto.Message {
|
||||
return &livekit.SignalResponse{
|
||||
Message: &livekit.SignalResponse_PublishDataTrackResponse{
|
||||
PublishDataTrackResponse: publishDataTrackResponse,
|
||||
@@ -245,7 +245,7 @@ func (u *signalling) SignalPublishDataTrackResponse(publishDataTrackResponse *li
|
||||
}
|
||||
}
|
||||
|
||||
func (u *signalling) SignalUnpublishDataTrackResponse(unpublishDataTrackResponse *livekit.UnpublishDataTrackResponse) proto.Message {
|
||||
func (s *signalling) SignalUnpublishDataTrackResponse(unpublishDataTrackResponse *livekit.UnpublishDataTrackResponse) proto.Message {
|
||||
return &livekit.SignalResponse{
|
||||
Message: &livekit.SignalResponse_UnpublishDataTrackResponse{
|
||||
UnpublishDataTrackResponse: unpublishDataTrackResponse,
|
||||
@@ -253,7 +253,7 @@ func (u *signalling) SignalUnpublishDataTrackResponse(unpublishDataTrackResponse
|
||||
}
|
||||
}
|
||||
|
||||
func (u *signalling) SignalDataTrackSubscriberHandles(dataTrackSubscriberHandles *livekit.DataTrackSubscriberHandles) proto.Message {
|
||||
func (s *signalling) SignalDataTrackSubscriberHandles(dataTrackSubscriberHandles *livekit.DataTrackSubscriberHandles) proto.Message {
|
||||
return &livekit.SignalResponse{
|
||||
Message: &livekit.SignalResponse_DataTrackSubscriberHandles{
|
||||
DataTrackSubscriberHandles: dataTrackSubscriberHandles,
|
||||
|
||||
@@ -243,10 +243,7 @@ func TestUnsubscribe(t *testing.T) {
|
||||
sm.lock.RLock()
|
||||
subLen := len(sm.subscriptions)
|
||||
sm.lock.RUnlock()
|
||||
if subLen != 0 {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return subLen == 0
|
||||
}, subSettleTimeout, subCheckInterval, "Track was not unsubscribed")
|
||||
|
||||
// no traces should be left
|
||||
|
||||
@@ -2547,11 +2547,12 @@ func (t *PCTransport) createAndSendOffer(options *webrtc.OfferOptions) error {
|
||||
}
|
||||
|
||||
// when there's an ongoing negotiation, let it finish and not disrupt its state
|
||||
if t.negotiationState == transport.NegotiationStateRemote {
|
||||
switch t.negotiationState {
|
||||
case transport.NegotiationStateRemote:
|
||||
t.params.Logger.Debugw("skipping negotiation, trying again later")
|
||||
t.setNegotiationState(transport.NegotiationStateRetry)
|
||||
return nil
|
||||
} else if t.negotiationState == transport.NegotiationStateRetry {
|
||||
case transport.NegotiationStateRetry:
|
||||
// already set to retry, we can safely skip this attempt
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user