Skip to content

Commit e93c47b

Browse files
committed
Merge branch 'main' of github.com:kean/Pulse
2 parents ba74c54 + efac97a commit e93c47b

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Pulse 5.x
22

3+
## Pulse 5.1.1
4+
5+
*Sep 19, 2024*
6+
7+
- Implement deep JSON redaction by @briancordanyoung in https://github.com/kean/Pulse/pull/292
8+
- Fix a CoreData multithreading issue in `LoggerStore.info()` by @ejensen in https://github.com/kean/Pulse/pull/293
9+
- Fix `ConsoleView` focus state clipping on tvOS by @ejensen in https://github.com/kean/Pulse/pull/295
10+
- Revert the removal of the `NetworkLogger`’s convenience initializer by @ejensen in https://github.com/kean/Pulse/pull/294
11+
12+
## Pulse 5.1
13+
14+
*Sep 16, 2024*
15+
16+
- 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.
17+
- 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`.
18+
- Fix an issue with thumbnails for image responses being too aggressively compressed and add `LoggerStore.ThumbnailOptions` to make it customizable
19+
- Update image response viewer to show thumbnails at a 2x resolution
20+
- Display thumbnail resolution in the response viewer
21+
- Fix an issue with app icons send too blurry to the Pulse Pro app
22+
- 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`.
23+
- Deprecate `UserSettings.displayHeaders` (user new `ConsoleListDisplaySettings` instead)
24+
- Fix xcprivacy warnings when used with SwiftPM, thanks to @alphatroya
25+
- Performance optimizations
26+
327
## Pulse 5.0
428

529
*Sep 4, 2024*

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The best way to start using Pulse is with the [**Getting Started**](https://kean
3333

3434
| Pulse | Swift | Xcode | Platforms |
3535
|------------|------------|-------------|--------------------------------------------------|
36-
| Pulse 5.0 | Swift 5.10 | Xcode 15.3 | iOS 15, tvOS 15, watchOS 8, macOS 12, visionOS 1 |
36+
| Pulse 5.0 | Swift 5.10 | Xcode 15.4 | iOS 15, tvOS 15, watchOS 8, macOS 12, visionOS 1 |
3737
| Pulse 4.0 | Swift 5.7 | Xcode 14.1 | iOS 14, tvOS 15, watchOS 8, macOS 12 |
3838

3939
## License

Sources/Pulse/LoggerStore/LoggerStore.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -766,9 +766,10 @@ extension LoggerStore {
766766
/// - parameter predicate: By default, `nil`.
767767
public func messages(
768768
sortDescriptors: [SortDescriptor<LoggerMessageEntity>] = [SortDescriptor(\.createdAt, order: .forward)],
769-
predicate: NSPredicate? = nil
769+
predicate: NSPredicate? = nil,
770+
context: NSManagedObjectContext? = nil
770771
) throws -> [LoggerMessageEntity] {
771-
try viewContext.fetch(LoggerMessageEntity.self) {
772+
try (context ?? viewContext).fetch(LoggerMessageEntity.self) {
772773
$0.sortDescriptors = sortDescriptors.map(NSSortDescriptor.init)
773774
$0.predicate = predicate
774775
}
@@ -781,9 +782,10 @@ extension LoggerStore {
781782
/// - parameter predicate: By default, `nil`.
782783
public func tasks(
783784
sortDescriptors: [SortDescriptor<NetworkTaskEntity>] = [SortDescriptor(\.createdAt, order: .forward)],
784-
predicate: NSPredicate? = nil
785+
predicate: NSPredicate? = nil,
786+
context: NSManagedObjectContext? = nil
785787
) throws -> [NetworkTaskEntity] {
786-
try viewContext.fetch(NetworkTaskEntity.self) {
788+
try (context ?? viewContext).fetch(NetworkTaskEntity.self) {
787789
$0.sortDescriptors = sortDescriptors.map(NSSortDescriptor.init)
788790
$0.predicate = predicate
789791
}

Sources/PulseUI/Helpers/HARDocument.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct HARDocument: Encodable {
1818
init(store: LoggerStore) throws {
1919
var entries: [Entry] = []
2020
var pages: [Page] = []
21-
try Dictionary(grouping: store.tasks(), by: \.url).values.forEach { networkTasks in
21+
try Dictionary(grouping: store.tasks(context: store.backgroundContext), by: \.url).values.forEach { networkTasks in
2222
let pageId = "page_\(pages.count)"
2323
pages.append(
2424
.init(
@@ -29,7 +29,7 @@ struct HARDocument: Encodable {
2929
)
3030
entries.append(contentsOf: networkTasks.map { .init(entity: $0, pageId: pageId) })
3131
}
32-
try store.messages().forEach { message in
32+
try store.messages(context: store.backgroundContext).forEach { message in
3333
if let task = message.task {
3434
entries.append(.init(entity: task, pageId: "page_\(pages.count)"))
3535
}

0 commit comments

Comments
 (0)