From 60cf2b2cae1856a0df92dfa64612a710fe3cd0af Mon Sep 17 00:00:00 2001 From: kean Date: Sun, 30 Apr 2023 09:49:50 -0400 Subject: [PATCH] Fix an issue with removeAll removing all sessions including current --- CHANGELOG.md | 10 ++++++++++ Pulse.xcodeproj/project.pbxproj | 4 ++-- Sources/Pulse/LoggerStore/LoggerStore.swift | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa20910b3..7cb52f74b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,15 @@ # Pulse 3.x +## Pulse 3.7.1 + +*Apr 30, 2023* + +- Fix an issue with `LoggerStore/removeAll` removing current session + ## Pulse 3.7.0 +*Apr 29, 2023* + - Improve search suggestions on macOS that are now [displayed inline](https://user-images.githubusercontent.com/1567433/235319231-caaabe2f-d173-4dca-b585-203c36ee70cc.png) and support the same search options as on iOS - Improve how search results are displayed on macOS - Improve search scope picker and allow searching for in more scopes @@ -21,6 +29,8 @@ ## Pulse 3.6.0 +*Apr 22, 2023* + ### PulseUI - Add new ["Sessions" screen](https://user-images.githubusercontent.com/1567433/233789699-08700704-0414-4a54-80af-c4c489d8c1d9.png)) where you can see all the previously recorded runs of the app. Tap on a session to see it in the "Console". Tap "Edit" to select one or more sessions, and then share only the selected sessions, delete them, or open them in the "Console". diff --git a/Pulse.xcodeproj/project.pbxproj b/Pulse.xcodeproj/project.pbxproj index 6ec43b703..0b4cdc8c6 100644 --- a/Pulse.xcodeproj/project.pbxproj +++ b/Pulse.xcodeproj/project.pbxproj @@ -2477,7 +2477,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 14.0; MACOSX_DEPLOYMENT_TARGET = 12.0; - MARKETING_VERSION = 3.7.0; + MARKETING_VERSION = 3.7.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "watchsimulator watchos macosx iphonesimulator iphoneos appletvsimulator appletvos"; @@ -2528,7 +2528,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 14.0; MACOSX_DEPLOYMENT_TARGET = 12.0; - MARKETING_VERSION = 3.7.0; + MARKETING_VERSION = 3.7.1; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = "watchsimulator watchos macosx iphonesimulator iphoneos appletvsimulator appletvos"; SUPPORTS_MACCATALYST = YES; diff --git a/Sources/Pulse/LoggerStore/LoggerStore.swift b/Sources/Pulse/LoggerStore/LoggerStore.swift index 76f6fbf5d..e4c2fd01c 100644 --- a/Sources/Pulse/LoggerStore/LoggerStore.swift +++ b/Sources/Pulse/LoggerStore/LoggerStore.swift @@ -174,8 +174,7 @@ public final class LoggerStore: @unchecked Sendable { if options.contains(.create) && !options.contains(.readonly) && configuration.isAutoStartingSession { perform { _ in - let appInfo = Info.AppInfo.make() - self.saveEntity(for: self.session, info: appInfo) + self.saveEntity(for: self.session, info: .make()) } } else { viewContext.performAndWait { @@ -750,6 +749,8 @@ extension LoggerStore { try? deleteEntities(for: LoggerMessageEntity.fetchRequest()) try? deleteEntities(for: LoggerBlobHandleEntity.fetchRequest()) try? deleteEntities(for: LoggerSessionEntity.fetchRequest()) + saveEntity(for: session, info: .make()) + try? Files.removeItem(at: blobsURL) Files.createDirectoryIfNeeded(at: blobsURL) case .archive: