Remove debug prints and fix build warnings

- Remove all print statements from planning engine, data providers, and PDF generation
- Fix deprecated CLGeocoder usage with MKLocalSearch for iOS 26
- Fix Swift 6 actor isolation by converting PDFGenerator/ExportService to @MainActor
- Add @retroactive to CLLocationCoordinate2D protocol conformances
- Fix unused variable warnings in GameDAGRouter and scenario planners
- Remove unreachable catch blocks in SettingsViewModel

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-08 13:25:27 -06:00
parent fbb5ae683e
commit 045fcd9c07
20 changed files with 188 additions and 303 deletions

View File

@@ -89,11 +89,15 @@ actor PDFAssetPrefetcher {
}
}
// Create immutable copies for concurrent access
let teamsToFetch = teams
let stadiumsToFetch = stadiums
// Run all fetches in parallel
async let routeMapTask = fetchRouteMap(stops: trip.stops)
async let cityMapsTask = fetchCityMaps(stops: trip.stops)
async let logosTask = imageService.fetchTeamLogos(teams: teams)
async let photosTask = imageService.fetchStadiumPhotos(stadiums: stadiums)
async let logosTask = imageService.fetchTeamLogos(teams: teamsToFetch)
async let photosTask = imageService.fetchStadiumPhotos(stadiums: stadiumsToFetch)
async let poisTask = poiService.findPOIsForCities(stops: trip.stops, limit: 5)
// Await each result and update progress
@@ -117,13 +121,6 @@ actor PDFAssetPrefetcher {
progress.poisComplete = true
await progressCallback?(progress)
print("[PDFAssetPrefetcher] Prefetch complete:")
print(" - Route map: \(routeMap != nil ? "OK" : "Failed")")
print(" - City maps: \(cityMaps.count) cities")
print(" - Team logos: \(teamLogos.count) logos")
print(" - Stadium photos: \(stadiumPhotos.count) photos")
print(" - POIs: \(cityPOIs.values.reduce(0) { $0 + $1.count }) total POIs")
return PrefetchedAssets(
routeMap: routeMap,
cityMaps: cityMaps,
@@ -141,7 +138,6 @@ actor PDFAssetPrefetcher {
let mapSize = CGSize(width: 512, height: 350)
return try await mapService.generateRouteMap(stops: stops, size: mapSize)
} catch {
print("[PDFAssetPrefetcher] Route map failed: \(error.localizedDescription)")
return nil
}
}
@@ -162,7 +158,6 @@ actor PDFAssetPrefetcher {
let map = try await self.mapService.generateCityMap(stop: stop, size: mapSize)
return (stop.city, map)
} catch {
print("[PDFAssetPrefetcher] City map for \(stop.city) failed: \(error.localizedDescription)")
return (stop.city, nil)
}
}

View File

@@ -128,7 +128,6 @@ actor POISearchService {
limit: limitPerCategory
)
} catch {
print("[POISearchService] Search failed for \(category): \(error.localizedDescription)")
return []
}
}
@@ -167,7 +166,6 @@ actor POISearchService {
// Take top N overall
return (stop.city, Array(pois.prefix(limit)))
} catch {
print("[POISearchService] Failed for \(stop.city): \(error.localizedDescription)")
return (stop.city, [])
}
}
@@ -208,11 +206,8 @@ actor POISearchService {
let pois: [POI] = response.mapItems.prefix(limit).compactMap { item in
guard let name = item.name else { return nil }
let itemLocation = CLLocation(
latitude: item.placemark.coordinate.latitude,
longitude: item.placemark.coordinate.longitude
)
let distance = referenceLocation.distance(from: itemLocation)
let itemCoordinate = item.location.coordinate
let distance = referenceLocation.distance(from: item.location)
// Only include POIs within radius
guard distance <= radiusMeters else { return nil }
@@ -221,22 +216,23 @@ actor POISearchService {
id: UUID(),
name: name,
category: category,
coordinate: item.placemark.coordinate,
coordinate: itemCoordinate,
distanceMeters: distance,
address: formatAddress(item.placemark)
address: formatAddress(item)
)
}
return pois
}
private func formatAddress(_ placemark: MKPlacemark) -> String? {
@available(iOS, deprecated: 26.0, message: "Uses placemark for address formatting")
private func formatAddress(_ item: MKMapItem) -> String? {
var components: [String] = []
if let subThoroughfare = placemark.subThoroughfare {
if let subThoroughfare = item.placemark.subThoroughfare {
components.append(subThoroughfare)
}
if let thoroughfare = placemark.thoroughfare {
if let thoroughfare = item.placemark.thoroughfare {
components.append(thoroughfare)
}

View File

@@ -95,7 +95,6 @@ actor RemoteImageService {
let image = try await self.fetchImage(from: url)
return (url, image)
} catch {
print("[RemoteImageService] Failed to fetch \(url): \(error.localizedDescription)")
return (url, nil)
}
}