From 2b8fc224419e12ba6a1964f25b6e66cb656c19d3 Mon Sep 17 00:00:00 2001 From: Alexey Martemyanov Date: Mon, 22 Jan 2024 16:36:54 +0600 Subject: [PATCH] disable Pixel for Safari Bookmarks.plist read permission request (#2098) Task/Issue URL: https://app.asana.com/0/0/1206403448888681/f --- .../DataImport/Bookmarks/Safari/SafariDataImporter.swift | 2 +- DuckDuckGo/DataImport/Model/DataImportViewModel.swift | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DuckDuckGo/DataImport/Bookmarks/Safari/SafariDataImporter.swift b/DuckDuckGo/DataImport/Bookmarks/Safari/SafariDataImporter.swift index 5da0fbb2d0..5c617bb2b7 100644 --- a/DuckDuckGo/DataImport/Bookmarks/Safari/SafariDataImporter.swift +++ b/DuckDuckGo/DataImport/Bookmarks/Safari/SafariDataImporter.swift @@ -60,7 +60,7 @@ final class SafariDataImporter: DataImporter { } } - static private let bookmarksFileName = "Bookmarks.plist" + static let bookmarksFileName = "Bookmarks.plist" private var fileUrl: URL { profile.profileURL.appendingPathComponent(Self.bookmarksFileName) diff --git a/DuckDuckGo/DataImport/Model/DataImportViewModel.swift b/DuckDuckGo/DataImport/Model/DataImportViewModel.swift index 4e9b8edea5..c0c7f1343e 100644 --- a/DuckDuckGo/DataImport/Model/DataImportViewModel.swift +++ b/DuckDuckGo/DataImport/Model/DataImportViewModel.swift @@ -308,7 +308,10 @@ struct DataImportViewModel { break } log("file read no permission for \(url.path)") - Pixel.fire(.dataImportFailed(source: importSource, sourceVersion: importSource.installedAppsMajorVersionDescription(selectedProfile: selectedProfile), error: importError)) + + if url != selectedProfile?.profileURL.appendingPathComponent(SafariDataImporter.bookmarksFileName) { + Pixel.fire(.dataImportFailed(source: importSource, sourceVersion: importSource.installedAppsMajorVersionDescription(selectedProfile: selectedProfile), error: importError)) + } screen = .getReadPermission(url) return true