From ac124342fa00923a139f8cdff1a1d4cd122ccbd7 Mon Sep 17 00:00:00 2001 From: alexandrev-tibco Date: Mon, 27 Apr 2026 15:31:54 +0200 Subject: [PATCH] Fix CrashlyticsService API signature and unused tagMap warning Co-Authored-By: Claude Sonnet 4.6 --- MealMood/Services/AutocompleteEngine.swift | 1 - MealMood/Services/CrashlyticsService.swift | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/MealMood/Services/AutocompleteEngine.swift b/MealMood/Services/AutocompleteEngine.swift index 90215b1..330886d 100644 --- a/MealMood/Services/AutocompleteEngine.swift +++ b/MealMood/Services/AutocompleteEngine.swift @@ -75,7 +75,6 @@ struct AutocompleteEngine { } static func findViolations(plan: WeekPlan, allDishes: [Dish], allTags: [Tag]) -> [RuleViolation] { - let tagMap = Dictionary(uniqueKeysWithValues: allTags.map { ($0.id, $0) }) let dishMap = Dictionary(uniqueKeysWithValues: allDishes.map { ($0.id, $0) }) return plan.slots.compactMap { slot in guard let dishId = slot.dishId, diff --git a/MealMood/Services/CrashlyticsService.swift b/MealMood/Services/CrashlyticsService.swift index c4e6913..c640074 100644 --- a/MealMood/Services/CrashlyticsService.swift +++ b/MealMood/Services/CrashlyticsService.swift @@ -11,16 +11,18 @@ enum CrashlyticsService { } static func record(_ error: Error, context: String? = nil) { - var userInfo: [String: Any] = [:] - if let context { userInfo["context"] = context } - Crashlytics.crashlytics().record(error: error, userInfo: userInfo) + if let context { + Crashlytics.crashlytics().setCustomValue(context, forKey: "context") + } + Crashlytics.crashlytics().record(error: error) } static func record(message: String, context: String? = nil) { - let userInfo: [String: Any] = context.map { ["context": $0] } ?? [:] + if let context { + Crashlytics.crashlytics().setCustomValue(context, forKey: "context") + } Crashlytics.crashlytics().record( - exceptionModel: ExceptionModel(name: "AppError", reason: message), - userInfo: userInfo + exceptionModel: ExceptionModel(name: "AppError", reason: message) ) } }