Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kean/Pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Oct 10, 2024
2 parents ba74c54 + efac97a commit e93c47b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions Sources/Pulse/LoggerStore/LoggerStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,10 @@ extension LoggerStore {
/// - parameter predicate: By default, `nil`.
public func messages(
sortDescriptors: [SortDescriptor<LoggerMessageEntity>] = [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
}
Expand All @@ -781,9 +782,10 @@ extension LoggerStore {
/// - parameter predicate: By default, `nil`.
public func tasks(
sortDescriptors: [SortDescriptor<NetworkTaskEntity>] = [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
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/PulseUI/Helpers/HARDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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)"))
}
Expand Down

0 comments on commit e93c47b

Please sign in to comment.