From 56b43dca860ebd67e3b068889f0a0e7fc64ef75d Mon Sep 17 00:00:00 2001 From: Robin Kutesa Date: Sat, 16 May 2026 10:55:54 +0300 Subject: [PATCH] Fix 5 build issues: add ButtonStyles to project, actor isolation, buffer mutability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Re-ran xcodegen so ButtonStyles.swift is included (fixes PrimaryButtonStyle and ScaleButtonStyle not in scope in LoginView and LANTriggerSection) - BackgroundTaskManager: access BackupEngine.shared inside @MainActor Task instead of nonisolated context - SFTPService: change var buffer → let (never mutated) Co-Authored-By: Claude Sonnet 4.6 --- NASBackup.xcodeproj/project.pbxproj | 9 ++++++--- Services/BackgroundTaskManager.swift | 7 +++---- Services/SFTPService.swift | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/NASBackup.xcodeproj/project.pbxproj b/NASBackup.xcodeproj/project.pbxproj index 41d70d9..c817431 100644 --- a/NASBackup.xcodeproj/project.pbxproj +++ b/NASBackup.xcodeproj/project.pbxproj @@ -37,6 +37,7 @@ DCE9AF4F0160E323224E3553 /* PhotoLibraryProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74E2AF8B56C469E0D94EFE94 /* PhotoLibraryProtocol.swift */; }; DF719EAD5727B335001DB50A /* ConnectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE318B60576B11E80862664D /* ConnectView.swift */; }; E830DB3078A8873382A77B63 /* BackupResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AEFE4959C08B94AE9584A11 /* BackupResult.swift */; }; + ED0D2A1D05B5898BCCE9EA0A /* ButtonStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA0969FC7D7E0EE313E29D55 /* ButtonStyles.swift */; }; F9219423E73718D8AB604EB1 /* ConnectionStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87319355D902007618A91AE /* ConnectionStore.swift */; }; FA646815F98D36CAB180072A /* BrowseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D947C8F8945A2AB081BBD0EF /* BrowseView.swift */; }; FDC18499CC21A58C2F6F1BDB /* BackupJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E762898E351192399FC739 /* BackupJob.swift */; }; @@ -65,8 +66,9 @@ A8F24C7DD7A503A0D561F3FB /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = ""; }; AC73AD75762D4357D171CDA4 /* BackupViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackupViewModel.swift; sourceTree = ""; }; B36E23852EF12DC14A2DF2DC /* NASBackupApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NASBackupApp.swift; sourceTree = ""; }; - C755BFDD42D46A3FB490A4BB /* NASBackup.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NASBackup.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C755BFDD42D46A3FB490A4BB /* NASBackup.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = NASBackup.app; sourceTree = BUILT_PRODUCTS_DIR; }; C955FEF6710E3667C7A73A02 /* ProgressRing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressRing.swift; sourceTree = ""; }; + CA0969FC7D7E0EE313E29D55 /* ButtonStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonStyles.swift; sourceTree = ""; }; D87319355D902007618A91AE /* ConnectionStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionStore.swift; sourceTree = ""; }; D947C8F8945A2AB081BBD0EF /* BrowseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BrowseView.swift; sourceTree = ""; }; DEBD92D10D70B957192E271F /* SMBService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SMBService.swift; sourceTree = ""; }; @@ -156,6 +158,7 @@ 3E7F8DE77B7CDC7009B54D63 /* Components */ = { isa = PBXGroup; children = ( + CA0969FC7D7E0EE313E29D55 /* ButtonStyles.swift */, 83C13DD3EB4823AA98D51AF2 /* FolderRow.swift */, C955FEF6710E3667C7A73A02 /* ProgressRing.swift */, 8845003C87961174302AC990 /* ToggleRow.swift */, @@ -307,6 +310,7 @@ LastUpgradeCheck = 1500; TargetAttributes = { 32316B985B8906FE4CB97730 = { + DevelopmentTeam = ""; ProvisioningStyle = Automatic; }; }; @@ -349,6 +353,7 @@ B7DBF1420838AD3397A280B5 /* BackupView.swift in Sources */, A6276840D40211EB446293A9 /* BackupViewModel.swift in Sources */, FA646815F98D36CAB180072A /* BrowseView.swift in Sources */, + ED0D2A1D05B5898BCCE9EA0A /* ButtonStyles.swift in Sources */, DF719EAD5727B335001DB50A /* ConnectView.swift in Sources */, C6AAC362F058E7836A91AC30 /* ConnectViewModel.swift in Sources */, F9219423E73718D8AB604EB1 /* ConnectionStore.swift in Sources */, @@ -382,7 +387,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = NASBackup.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - DEVELOPMENT_TEAM = K8BLMMR883; INFOPLIST_FILE = App/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -467,7 +471,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = NASBackup.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; - DEVELOPMENT_TEAM = K8BLMMR883; INFOPLIST_FILE = App/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/Services/BackgroundTaskManager.swift b/Services/BackgroundTaskManager.swift index 3cabfb4..92f7538 100644 --- a/Services/BackgroundTaskManager.swift +++ b/Services/BackgroundTaskManager.swift @@ -47,9 +47,8 @@ final class BackgroundTaskManager { private static func handleBackupTask(_ task: BGProcessingTask) { scheduleBackup() - let engine = BackupEngine.shared - task.expirationHandler = { Task { await engine.cancel() } } - Task { + task.expirationHandler = { Task { await BackupEngine.shared.cancel() } } + Task { @MainActor in do { let store = ConnectionStore.shared guard let connection = store.savedConnection else { @@ -57,7 +56,7 @@ final class BackgroundTaskManager { return } let filter = store.backupFilter - _ = try await engine.run(connection: connection, filter: filter, triggeredByLAN: true) + _ = try await BackupEngine.shared.run(connection: connection, filter: filter, triggeredByLAN: true) task.setTaskCompleted(success: true) } catch { task.setTaskCompleted(success: false) diff --git a/Services/SFTPService.swift b/Services/SFTPService.swift index 4040b8d..c91aca5 100644 --- a/Services/SFTPService.swift +++ b/Services/SFTPService.swift @@ -89,7 +89,7 @@ final class SFTPService: NASTransferProtocol { filePath: remotePath, flags: [.write, .create, .truncate] ) { file in - var buffer = ByteBuffer(data: data) + let buffer = ByteBuffer(data: data) try await file.write(buffer, at: 0) } progress(total, total)