From 8616fd0a978d86e8eb83cb1a78b1697c88bf6aaf Mon Sep 17 00:00:00 2001 From: Alex Grebenyuk Date: Thu, 19 Sep 2024 20:37:43 -0400 Subject: [PATCH 1/3] Update CHANGELOG.md --- CHANGELOG.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fac3d480..3315fa6f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Pulse 5.x +## Pulse 5.1.1 + +*Sep 19, 2024* + +- Implement deep JSON redaction by @briancordanyoung in https://github.com/kean/Pulse/pull/292 +- Fix a CoreData multithreading issue in `LoggerStore.info()` by @ejensen in https://github.com/kean/Pulse/pull/293 +- Fix `ConsoleView` focus state clipping on tvOS by @ejensen in https://github.com/kean/Pulse/pull/295 +- Revert the removal of the `NetworkLogger`’s convenience initializer by @ejensen in https://github.com/kean/Pulse/pull/294 + +## Pulse 5.1 + +*Sep 16, 2024* + +- Introduce an enhanced design for console cells with improved information hierarchy. It has multiple tweaks, but the main change is how the URLs are formatted. By default, the console will now show only the path with a host as a secondary field below it. +- Add new convenience APIs for accessing messages and tasks stored in the logger: `LoggerStore/message(sortDescriptors:predicate:)` and `LoggerStore/tasks(sortDescriptors:predicate:)`. Deprecate `allTasks` and `allMessages`. +- Fix an issue with thumbnails for image responses being too aggressively compressed and add `LoggerStore.ThumbnailOptions` to make it customizable +- Update image response viewer to show thumbnails at a 2x resolution +- Display thumbnail resolution in the response viewer +- Fix an issue with app icons send too blurry to the Pulse Pro app +- Improve support for `.inMemory` store option, which is now guaranteed to not write anything on disk, including the store manifest. It also no longer requires the `.create` option like the regular store and the `storeURL` parameter can point to anything, including `/dev/null`. +- Deprecate `UserSettings.displayHeaders` (user new `ConsoleListDisplaySettings` instead) +- Fix xcprivacy warnings when used with SwiftPM, thanks to @alphatroya +- Performance optimizations + ## Pulse 5.0 *Sep 4, 2024* From 2a0d1f53a54335b43f04a08a4ff5bf37c40dce19 Mon Sep 17 00:00:00 2001 From: Alex Grebenyuk Date: Wed, 2 Oct 2024 07:57:51 -0400 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b4dbad0c..fcaf1d2b0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The best way to start using Pulse is with the [**Getting Started**](https://kean | Pulse | Swift | Xcode | Platforms | |------------|------------|-------------|--------------------------------------------------| -| Pulse 5.0 | Swift 5.10 | Xcode 15.3 | iOS 15, tvOS 15, watchOS 8, macOS 12, visionOS 1 | +| Pulse 5.0 | Swift 5.10 | Xcode 15.4 | iOS 15, tvOS 15, watchOS 8, macOS 12, visionOS 1 | | Pulse 4.0 | Swift 5.7 | Xcode 14.1 | iOS 14, tvOS 15, watchOS 8, macOS 12 | ## License From 3dd1cbdbdfea12fb10a3f1c25dff9480be96d1cc Mon Sep 17 00:00:00 2001 From: Rounak Jain Date: Fri, 4 Oct 2024 10:46:14 -0700 Subject: [PATCH 3/3] fix crash when exporting HAR by using background context --- Sources/Pulse/LoggerStore/LoggerStore.swift | 10 ++++++---- Sources/PulseUI/Helpers/HARDocument.swift | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Sources/Pulse/LoggerStore/LoggerStore.swift b/Sources/Pulse/LoggerStore/LoggerStore.swift index 20b838487..0dabc4846 100644 --- a/Sources/Pulse/LoggerStore/LoggerStore.swift +++ b/Sources/Pulse/LoggerStore/LoggerStore.swift @@ -766,9 +766,10 @@ extension LoggerStore { /// - parameter predicate: By default, `nil`. public func messages( sortDescriptors: [SortDescriptor] = [SortDescriptor(\.createdAt, order: .forward)], - predicate: NSPredicate? = nil + predicate: NSPredicate? = nil, + context: NSManagedObjectContext? = nil ) throws -> [LoggerMessageEntity] { - try viewContext.fetch(LoggerMessageEntity.self) { + try (context ?? viewContext).fetch(LoggerMessageEntity.self) { $0.sortDescriptors = sortDescriptors.map(NSSortDescriptor.init) $0.predicate = predicate } @@ -781,9 +782,10 @@ extension LoggerStore { /// - parameter predicate: By default, `nil`. public func tasks( sortDescriptors: [SortDescriptor] = [SortDescriptor(\.createdAt, order: .forward)], - predicate: NSPredicate? = nil + predicate: NSPredicate? = nil, + context: NSManagedObjectContext? = nil ) throws -> [NetworkTaskEntity] { - try viewContext.fetch(NetworkTaskEntity.self) { + try (context ?? viewContext).fetch(NetworkTaskEntity.self) { $0.sortDescriptors = sortDescriptors.map(NSSortDescriptor.init) $0.predicate = predicate } diff --git a/Sources/PulseUI/Helpers/HARDocument.swift b/Sources/PulseUI/Helpers/HARDocument.swift index a419af1a8..9457e3003 100644 --- a/Sources/PulseUI/Helpers/HARDocument.swift +++ b/Sources/PulseUI/Helpers/HARDocument.swift @@ -18,7 +18,7 @@ struct HARDocument: Encodable { init(store: LoggerStore) throws { var entries: [Entry] = [] var pages: [Page] = [] - try Dictionary(grouping: store.tasks(), by: \.url).values.forEach { networkTasks in + try Dictionary(grouping: store.tasks(context: store.backgroundContext), by: \.url).values.forEach { networkTasks in let pageId = "page_\(pages.count)" pages.append( .init( @@ -29,7 +29,7 @@ struct HARDocument: Encodable { ) entries.append(contentsOf: networkTasks.map { .init(entity: $0, pageId: pageId) }) } - try store.messages().forEach { message in + try store.messages(context: store.backgroundContext).forEach { message in if let task = message.task { entries.append(.init(entity: task, pageId: "page_\(pages.count)")) }