From 32bcf8dc26f50678c072d19b60d738039df2daed Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Sat, 4 Oct 2025 15:24:49 -0700 Subject: [PATCH] feat: Implement photo performance optimization and introduce new photo management features - Added a comprehensive document detailing performance optimizations for the photo grid, addressing issues with loading and caching. - Introduced `PhotoThumbnailCache` for efficient thumbnail management, leveraging `PHCachingImageManager` and `NSCache`. - Updated `PhotoManager2` to utilize a singleton pattern for shared access and improved photo loading strategies. - Enhanced `PhotosViewModel` and `PhotosView` to support pagination and optimized thumbnail loading for smoother user experience. - Created new views and components for managing photo backups and displaying photo details, including a job monitor for background tasks. - Refactored existing code to improve structure and maintainability, ensuring better performance with large photo libraries. --- .../Sources/SpacedriveClient/SpacedriveClient.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/swift-client/Sources/SpacedriveClient/SpacedriveClient.swift b/packages/swift-client/Sources/SpacedriveClient/SpacedriveClient.swift index 2902f201d..35a78042f 100644 --- a/packages/swift-client/Sources/SpacedriveClient/SpacedriveClient.swift +++ b/packages/swift-client/Sources/SpacedriveClient/SpacedriveClient.swift @@ -163,7 +163,10 @@ public class SpacedriveClient { // Encode input to JSON for non-unit types let requestData: Data do { - requestData = try JSONEncoder().encode(requestPayload) + let encoder = JSONEncoder() + // Don't omit nil values - we need them to be present as null + // This is handled by the Codable implementation of the structs + requestData = try encoder.encode(requestPayload) } catch { throw SpacedriveError.serializationError("Failed to encode request: \(error)") }