fix: guard toJSON() debug call with #if DEBUG in ProfileView#214
Merged
sebastianricaldoni merged 6 commits intoJun 11, 2026
Merged
Conversation
- Add finalizeOpenActions() to close pending "Opened X" actions when app backgrounds, fixing zero-duration bug when app is killed mid-game - Move reset() logic to UIApplication.willEnterForegroundNotification observer on ActivityLogEntry (synchronous, fires before SwiftUI views) to avoid race condition with async saveLog on background - Add didBecomeActiveNotification handler in ActivityLogBaseView with isVisible guard to re-log current view on resume when onAppear does not fire reliably - Add Home view logging via ActivityLogBaseView wrapper - Add Encodable.toJSON() debug utility in BalanceExtensions - Fix WKCompanionAppBundleIdentifier for local device signing
…model Replace fragile "Opened X" / "Closed X" string-matching with a clean push(viewName:) + finalizePending() stack model: - push() finalizes previous pending entry then opens a new one - finalizePending() closes current entry with correct duration - onDisappear only finalizes if pendingEntry matches view (guards against forward-nav double-finalize since onAppear fires first) - ActivityLogEntry observes willEnterForegroundNotification directly (synchronous, before SwiftUI views) to guarantee reset fires before any onAppear on resume - ActivityLogBaseView uses didBecomeActiveNotification + isVisible guard to re-push current view when onAppear does not fire on resume - Home ActivityLogBaseView moved inside NavigationStack root so onAppear/onDisappear fire correctly on forward/back navigation - Rename actions → entries (CodingKeys maps to "actions" for backwards compatibility with existing user data) - addActionButton renamed to addButtonEvent for clarity - Coins eligibility extracted to Set<String> replacing long if-chain - ProfileView share buttons do fresh file load on tap (single source of truth); ShareLink replaced with Button + UIActivityViewController - SpotifyViewController updated to new push/finalizePending API
…me-session-duration-logging
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
=====================================
Coverage 5.23% 5.23%
=====================================
Files 130 130
Lines 2142 2142
=====================================
Hits 112 112
Misses 2030 2030
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
toJSON()call inProfileView.loadLogs()with#if DEBUGguardtoJSON()is defined only in#if DEBUG— Release builds (Fastlane/TestFlight) would fail to compile without this guardTest plan
loadLogs()🤖 Generated with Claude Code