From 55e2a72a90dc2dcce7576dc76e4e0198ed2e1b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Wed, 11 Mar 2026 19:05:38 +0100 Subject: [PATCH] Fix notification sync sematics --- NearbyShare/Connection/InboundNearbyConnection.swift | 2 +- NearbyShare/Connection/NearbyConnectionManager.swift | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NearbyShare/Connection/InboundNearbyConnection.swift b/NearbyShare/Connection/InboundNearbyConnection.swift index 6af4f9c..001f110 100644 --- a/NearbyShare/Connection/InboundNearbyConnection.swift +++ b/NearbyShare/Connection/InboundNearbyConnection.swift @@ -611,7 +611,7 @@ class InboundNearbyConnection: NearbyConnection { id: id, pinCode: pinCode, transferType: .notificationSync, - allowsToBeAddedAsTrustedDevice: false + allowsToBeAddedAsTrustedDevice: true ) DispatchQueue.main.async { diff --git a/NearbyShare/Connection/NearbyConnectionManager.swift b/NearbyShare/Connection/NearbyConnectionManager.swift index 4203623..3ffb4f7 100644 --- a/NearbyShare/Connection/NearbyConnectionManager.swift +++ b/NearbyShare/Connection/NearbyConnectionManager.swift @@ -361,7 +361,9 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb func connectionWasTerminated(connection: InboundNearbyConnection, savedFiles: [URL], error: Error?) { incomingConnections.removeValue(forKey: connection.id) - if connection.shouldSuppressAppDelegates { + // Notification-sync transfers suppress normal success callbacks, but + // still forward failures so pending consent/error UI can be cleaned up. + if connection.shouldSuppressAppDelegates, error == nil { return }