Ensure we are not halting the entire application when trying to generate the debug...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 5 Nov 2024 08:40:47 +0000 (17:40 +0900)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 22 Nov 2024 09:08:32 +0000 (10:08 +0100)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/macOS/fileproviderxpc.h
src/gui/macOS/fileproviderxpc_mac.mm

index 39bc86397ac6daa83442e5e6874962f7fcc1766a..6dfbb065098d4eb9a382a768a45c897037719ea2 100644 (file)
@@ -45,7 +45,7 @@ public slots:
     void configureExtensions();
     void authenticateExtension(const QString &extensionAccountId) const;
     void unauthenticateExtension(const QString &extensionAccountId) const;
-    void createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename) const;
+    void createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename);
 
     void setFastEnumerationEnabledForExtension(const QString &extensionAccountId, bool enabled) const;
 
index cc4b14a2aff0850f5c0fb2e888ee5dc6989b5834..60fe7c2a54f2af1e6fdf1852d09222defef1cb56 100644 (file)
@@ -111,9 +111,13 @@ void FileProviderXPC::slotAccountStateChanged(const AccountState::State state) c
         break;
     }
 }
-void FileProviderXPC::createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename) const
+void FileProviderXPC::createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename)
 {
     qCInfo(lcFileProviderXPC) << "Creating debug archive for extension" << extensionAccountId << "at" << filename;
+    if (!fileProviderExtReachable(extensionAccountId)) {
+        qCWarning(lcFileProviderXPC) << "Extension is not reachable. Cannot create debug archive";
+        return;
+    }
     // You need to fetch the contents from the extension and then create the archive from the client side.
     // The extension is not allowed to ask for permission to write into the file system as it is not a user facing process.
     const auto clientCommService = (NSObject<ClientCommunicationProtocol> *)_clientCommServices.value(extensionAccountId);