mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 02:45:19 +00:00
chore(BLE): trim raw hex dump on central decode failure to length+prefix
This commit is contained in:
@@ -2672,7 +2672,8 @@ extension BLEService: CBPeripheralManagerDelegate {
|
||||
}
|
||||
// If this was a single short write and still failed, log the raw chunk for debugging
|
||||
if !hasMultiple, let only = sorted.first, let raw = only.value {
|
||||
SecureLogger.log("❌ Failed to decode packet from central, full data: \(raw.map { String(format: "%02x", $0) }.joined(separator: " "))", category: SecureLogger.session, level: .error)
|
||||
let prefix = raw.prefix(16).map { String(format: "%02x", $0) }.joined(separator: " ")
|
||||
SecureLogger.log("❌ Failed to decode packet from central (len=\(raw.count), prefix=\(prefix))", category: SecureLogger.session, level: .error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@ final class NostrTransport: Transport {
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
@MainActor
|
||||
private func resolveRecipientNpub(for peerID: String) -> String? {
|
||||
if let noiseKey = Data(hexString: peerID),
|
||||
let fav = FavoritesPersistenceService.shared.getFavoriteStatus(for: noiseKey),
|
||||
|
||||
Reference in New Issue
Block a user