Commit 6ba2e50325
Unsigned
Layout: unified · split
Hutch.xcodeproj/project.pbxproj +8 −8
| @@ -515,7 +515,7 @@ | ||
| 515 | 515 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 516 | 516 | CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements; |
| 517 | 517 | CODE_SIGN_STYLE = Automatic; |
| 518 | CURRENT_PROJECT_VERSION = 32; | |
| 518 | CURRENT_PROJECT_VERSION = 33; | |
| 519 | 519 | DEVELOPMENT_TEAM = ZCNAX3VL9D; |
| 520 | 520 | ENABLE_PREVIEWS = YES; |
| 521 | 521 | GENERATE_INFOPLIST_FILE = YES; |
| @@ -532,7 +532,7 @@ | ||
| 532 | 532 | "$(inherited)", |
| 533 | 533 | "@executable_path/Frameworks", |
| 534 | 534 | ); |
| 535 | MARKETING_VERSION = 2.15.0; | |
| 535 | MARKETING_VERSION = 2.15.1; | |
| 536 | 536 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch; |
| 537 | 537 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 538 | 538 | STRING_CATALOG_GENERATE_SYMBOLS = YES; |
| @@ -552,7 +552,7 @@ | ||
| 552 | 552 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 553 | 553 | CODE_SIGN_ENTITLEMENTS = Hutch/Hutch.entitlements; |
| 554 | 554 | CODE_SIGN_STYLE = Automatic; |
| 555 | CURRENT_PROJECT_VERSION = 32; | |
| 555 | CURRENT_PROJECT_VERSION = 33; | |
| 556 | 556 | DEVELOPMENT_TEAM = ZCNAX3VL9D; |
| 557 | 557 | ENABLE_PREVIEWS = YES; |
| 558 | 558 | GENERATE_INFOPLIST_FILE = YES; |
| @@ -569,7 +569,7 @@ | ||
| 569 | 569 | "$(inherited)", |
| 570 | 570 | "@executable_path/Frameworks", |
| 571 | 571 | ); |
| 572 | MARKETING_VERSION = 2.15.0; | |
| 572 | MARKETING_VERSION = 2.15.1; | |
| 573 | 573 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch; |
| 574 | 574 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 575 | 575 | STRING_CATALOG_GENERATE_SYMBOLS = YES; |
| @@ -632,7 +632,7 @@ | ||
| 632 | 632 | APPLICATION_EXTENSION_API_ONLY = YES; |
| 633 | 633 | CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements; |
| 634 | 634 | CODE_SIGN_STYLE = Automatic; |
| 635 | CURRENT_PROJECT_VERSION = 32; | |
| 635 | CURRENT_PROJECT_VERSION = 33; | |
| 636 | 636 | DEVELOPMENT_TEAM = ZCNAX3VL9D; |
| 637 | 637 | GENERATE_INFOPLIST_FILE = NO; |
| 638 | 638 | INFOPLIST_FILE = HutchWidgetExtension/Info.plist; |
| @@ -642,7 +642,7 @@ | ||
| 642 | 642 | "@executable_path/Frameworks", |
| 643 | 643 | "@executable_path/../../Frameworks", |
| 644 | 644 | ); |
| 645 | MARKETING_VERSION = 2.15.0; | |
| 645 | MARKETING_VERSION = 2.15.1; | |
| 646 | 646 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension; |
| 647 | 647 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 648 | 648 | SKIP_INSTALL = YES; |
| @@ -661,7 +661,7 @@ | ||
| 661 | 661 | APPLICATION_EXTENSION_API_ONLY = YES; |
| 662 | 662 | CODE_SIGN_ENTITLEMENTS = HutchWidgetExtension/HutchWidgetExtension.entitlements; |
| 663 | 663 | CODE_SIGN_STYLE = Automatic; |
| 664 | CURRENT_PROJECT_VERSION = 32; | |
| 664 | CURRENT_PROJECT_VERSION = 33; | |
| 665 | 665 | DEVELOPMENT_TEAM = ZCNAX3VL9D; |
| 666 | 666 | GENERATE_INFOPLIST_FILE = NO; |
| 667 | 667 | INFOPLIST_FILE = HutchWidgetExtension/Info.plist; |
| @@ -671,7 +671,7 @@ | ||
| 671 | 671 | "@executable_path/Frameworks", |
| 672 | 672 | "@executable_path/../../Frameworks", |
| 673 | 673 | ); |
| 674 | MARKETING_VERSION = 2.15.0; | |
| 674 | MARKETING_VERSION = 2.15.1; | |
| 675 | 675 | PRODUCT_BUNDLE_IDENTIFIER = net.cleberg.Hutch.HutchWidgetExtension; |
| 676 | 676 | PRODUCT_NAME = "$(TARGET_NAME)"; |
| 677 | 677 | SKIP_INSTALL = YES; |
Hutch/Networking/HutchStatsService.swift −12
| @@ -20,7 +20,6 @@ struct HutchStatsService: ContributionCalendarServing { | ||
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | func fetchContributionCalendar(actor: String, endingOn endDate: Date) async throws -> ContributionCalendarResponse { |
| 23 | debugLog("calendar request actor=\(actor) endDate=\(Self.rangeFormatter.string(from: endDate))") | |
| 24 | 23 | return try await fetch( |
| 25 | 24 | path: "api/contributions/\(actor)", |
| 26 | 25 | queryItems: trailingYearQueryItems(endingOn: endDate), |
| @@ -29,7 +28,6 @@ struct HutchStatsService: ContributionCalendarServing { | ||
| 29 | 28 | } |
| 30 | 29 | |
| 31 | 30 | func fetchContributionStats(actor: String, endingOn endDate: Date) async throws -> ContributionStatsResponse { |
| 32 | debugLog("stats request actor=\(actor) endDate=\(Self.rangeFormatter.string(from: endDate))") | |
| 33 | 31 | return try await fetch( |
| 34 | 32 | path: "api/contributions/\(actor)/stats", |
| 35 | 33 | queryItems: trailingYearQueryItems(endingOn: endDate), |
| @@ -53,17 +51,14 @@ struct HutchStatsService: ContributionCalendarServing { | ||
| 53 | 51 | throw URLError(.badURL) |
| 54 | 52 | } |
| 55 | 53 | |
| 56 | debugLog("request \(url.absoluteString)") | |
| 57 | 54 | let (data, response): (Data, URLResponse) |
| 58 | 55 | do { |
| 59 | 56 | (data, response) = try await session.data(from: url) |
| 60 | 57 | } catch { |
| 61 | debugLog("network failure \(url.absoluteString) error=\(error.localizedDescription)") | |
| 62 | 58 | throw SRHTError.networkError(error) |
| 63 | 59 | } |
| 64 | 60 | |
| 65 | 61 | if let httpResponse = response as? HTTPURLResponse { |
| 66 | debugLog("response \(url.absoluteString) status=\(httpResponse.statusCode) bytes=\(data.count)") | |
| 67 | 62 | if !(200...299).contains(httpResponse.statusCode) { |
| 68 | 63 | throw SRHTError.httpError(httpResponse.statusCode) |
| 69 | 64 | } |
| @@ -72,8 +67,6 @@ struct HutchStatsService: ContributionCalendarServing { | ||
| 72 | 67 | do { |
| 73 | 68 | return try decoder.decode(responseType, from: data) |
| 74 | 69 | } catch { |
| 75 | let preview = String(decoding: data.prefix(300), as: UTF8.self) | |
| 76 | debugLog("decode failure \(url.absoluteString) error=\(error.localizedDescription) body=\(preview)") | |
| 77 | 70 | throw SRHTError.decodingError(error) |
| 78 | 71 | } |
| 79 | 72 | } |
| @@ -113,9 +106,4 @@ struct HutchStatsService: ContributionCalendarServing { | ||
| 113 | 106 | return formatter |
| 114 | 107 | }() |
| 115 | 108 | |
| 116 | private func debugLog(_ message: String) { | |
| 117 | #if DEBUG | |
| 118 | print("[HutchStatsService] \(message)") | |
| 119 | #endif | |
| 120 | } | |
| 121 | 109 | } |
Hutch/Views/Builds/BuildDetailViewModel.swift −4
| @@ -315,8 +315,6 @@ final class BuildDetailViewModel { | ||
| 315 | 315 | guard autoRefreshTask == nil else { return } |
| 316 | 316 | guard shouldAutoRefresh else { return } |
| 317 | 317 | |
| 318 | print("Build auto-refresh started") | |
| 319 | ||
| 320 | 318 | autoRefreshTask = Task { [weak self] in |
| 321 | 319 | while !Task.isCancelled { |
| 322 | 320 | do { |
| @@ -336,7 +334,6 @@ final class BuildDetailViewModel { | ||
| 336 | 334 | |
| 337 | 335 | autoRefreshTask.cancel() |
| 338 | 336 | self.autoRefreshTask = nil |
| 339 | print("Build auto-refresh stopped") | |
| 340 | 337 | } |
| 341 | 338 | |
| 342 | 339 | private var shouldAutoRefresh: Bool { |
| @@ -352,7 +349,6 @@ final class BuildDetailViewModel { | ||
| 352 | 349 | return |
| 353 | 350 | } |
| 354 | 351 | |
| 355 | print("Build refresh tick") | |
| 356 | 352 | await loadJob() |
| 357 | 353 | await loadBuildLog() |
| 358 | 354 | } |
Hutch/Views/Lookup/ContributionCalendarViewModel.swift −12
| @@ -116,8 +116,6 @@ final class ContributionCalendarViewModel { | ||
| 116 | 116 | isLoading = true |
| 117 | 117 | loadErrorMessage = nil |
| 118 | 118 | defer { isLoading = false } |
| 119 | debugLog("load start actor=\(actor) endDate=\(selectedEndDate.formatted(date: .abbreviated, time: .omitted))") | |
| 120 | ||
| 121 | 119 | let fetchedCalendar: ContributionCalendarResponse? |
| 122 | 120 | let fetchedStats: ContributionStatsResponse? |
| 123 | 121 | var errors: [any Error] = [] |
| @@ -147,11 +145,6 @@ final class ContributionCalendarViewModel { | ||
| 147 | 145 | loadErrorMessage = errors.first?.userFacingMessage |
| 148 | 146 | } |
| 149 | 147 | |
| 150 | debugLog( | |
| 151 | "load complete actor=\(actor) endDate=\(selectedEndDate.formatted(date: .abbreviated, time: .omitted)) state=\(String(describing: displayState)) " + | |
| 152 | "calendarDays=\(calendar?.days.count ?? 0) totalEvents=\(stats?.totalEvents ?? 0) " + | |
| 153 | "indexingState=\(String(describing: effectiveIndexingState)) error=\(loadErrorMessage ?? "none")" | |
| 154 | ) | |
| 155 | 148 | } |
| 156 | 149 | |
| 157 | 150 | func selectPreviousYear() async { |
| @@ -196,9 +189,4 @@ final class ContributionCalendarViewModel { | ||
| 196 | 189 | return normalizedStartDate...normalizedEndDate |
| 197 | 190 | } |
| 198 | 191 | |
| 199 | private func debugLog(_ message: String) { | |
| 200 | #if DEBUG | |
| 201 | print("[ContributionCalendarViewModel] \(message)") | |
| 202 | #endif | |
| 203 | } | |
| 204 | 192 | } |
Hutch/Views/Lookup/LookupView.swift −4
| @@ -201,8 +201,6 @@ final class LookupViewModel { | ||
| 201 | 201 | } |
| 202 | 202 | """ |
| 203 | 203 | |
| 204 | lookupLogger.debug("Looking up user profile for username: \(username, privacy: .public)") | |
| 205 | ||
| 206 | 204 | let result: Response |
| 207 | 205 | do { |
| 208 | 206 | result = try await client.execute( |
| @@ -225,8 +223,6 @@ final class LookupViewModel { | ||
| 225 | 223 | throw error |
| 226 | 224 | } |
| 227 | 225 | |
| 228 | lookupLogger.debug("User lookup succeeded for username: \(username, privacy: .public)") | |
| 229 | ||
| 230 | 226 | return .user(result.user) |
| 231 | 227 | } |
| 232 | 228 | |
Hutch/Views/Lookup/UserProfileViewModel.swift −16
| @@ -85,8 +85,6 @@ final class UserProfileViewModel { | ||
| 85 | 85 | defer { isLoadingContributions = false } |
| 86 | 86 | |
| 87 | 87 | let resolvedEndDate = Calendar.contributionCalendar.startOfDay(for: endDate ?? Date()) |
| 88 | debugLog("profile contributions start actor=\(actor) endDate=\(resolvedEndDate.formatted(date: .abbreviated, time: .omitted))") | |
| 89 | ||
| 90 | 88 | do { |
| 91 | 89 | async let contributionCalendar = statsService.fetchContributionCalendar(actor: actor, endingOn: resolvedEndDate) |
| 92 | 90 | async let contributionStats = statsService.fetchContributionStats(actor: actor, endingOn: resolvedEndDate) |
| @@ -96,17 +94,8 @@ final class UserProfileViewModel { | ||
| 96 | 94 | if contributionDisplayState != .unavailable { |
| 97 | 95 | contributionsError = nil |
| 98 | 96 | } |
| 99 | debugLog( | |
| 100 | "profile contributions complete actor=\(actor) endDate=\(resolvedEndDate.formatted(date: .abbreviated, time: .omitted)) " + | |
| 101 | "state=\(String(describing: contributionDisplayState)) days=\(self.contributionCalendar?.days.count ?? 0) " + | |
| 102 | "totalEvents=\(self.contributionStats?.totalEvents ?? 0) error=\(contributionsError ?? "none")" | |
| 103 | ) | |
| 104 | 97 | } catch { |
| 105 | 98 | contributionsError = error.userFacingMessage |
| 106 | debugLog( | |
| 107 | "profile contributions failed actor=\(actor) endDate=\(resolvedEndDate.formatted(date: .abbreviated, time: .omitted)) " + | |
| 108 | "error=\(error.localizedDescription) userFacing=\(contributionsError ?? "none")" | |
| 109 | ) | |
| 110 | 99 | } |
| 111 | 100 | } |
| 112 | 101 | |
| @@ -232,9 +221,4 @@ final class UserProfileViewModel { | ||
| 232 | 221 | } |
| 233 | 222 | } |
| 234 | 223 | |
| 235 | private func debugLog(_ message: String) { | |
| 236 | #if DEBUG | |
| 237 | print("[UserProfileViewModel] \(message)") | |
| 238 | #endif | |
| 239 | } | |
| 240 | 224 | } |