Improve logging

This commit is contained in:
Leon Böttger committed 2025-08-11 16:12:00 +02:00
1 parent 89a0569ffe
commit e33f16f048
2 files changed
+16

No files matched your search

@@ -115,6 +115,14 @@ class InboundNearbyConnection: NearbyConnection {
case .receivedPairedKeyResult:
try processIntroductionFrame(frame)
default:
if frame.hasV1, frame.v1.hasType, frame.v1.type == .progressUpdate {
// ignore progress updates
return
}
if frame.hasV1, frame.v1.hasType, frame.v1.type == .response, case .accept = frame.v1.connectionResponse.status {
// ignore accept response frame, it is inferred since the other device set up the connection
return
}
log("[InboundNearbyConnection \(self.id)] Unexpected connection state in processTransferSetupFrame: \(currentState)")
log(frame.debugDescription)
}
@@ -65,6 +65,9 @@ class NearbyConnection {
func start() {
log("[NearbyConnection \(self.id)] Starting connection.")
connection.stateUpdateHandler = { state in
if !self.connectionClosed {
@@ -425,6 +428,11 @@ class NearbyConnection {
sendKeepAlive(ack: true)
} else {
if offlineFrame.hasV1, offlineFrame.v1.hasType, offlineFrame.v1.type == .bandwidthUpgradeRetry {
// only supporting WiFi for now, ignore upgrade request to other mediums
return
}
log("[NearbyConnection \(self.id)] Unhandled offline frame encrypted: \(offlineFrame)")
}
}