Skip to content

fix: restore edu.stanford WKCompanionAppBundleIdentifier for Release build#215

Merged
sebastianricaldoni merged 8 commits into
mainfrom
bug/BAL-211-SR-fix-game-session-duration-logging
Jun 11, 2026
Merged

fix: restore edu.stanford WKCompanionAppBundleIdentifier for Release build#215
sebastianricaldoni merged 8 commits into
mainfrom
bug/BAL-211-SR-fix-game-session-duration-logging

Conversation

@sebastianricaldoni

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes TestFlight upload error: Invalid WKCompanionAppBundleIdentifier (409)
  • Release build now uses edu.stanford.cs342.2023.balance to match the parent app's CFBundleIdentifier
  • Debug build retains com.celteeka.cs342.2023.balance for local device development

Root cause

A previous commit set WKCompanionAppBundleIdentifier to com.celteeka in both Debug and Release configs to fix local device signing. Release should always match the Stanford bundle ID expected by App Store Connect.

Test plan

  • Fastlane beta upload succeeds without 409 error
  • Local device build (Debug) still works with personal bundle ID

🤖 Generated with Claude Code

- 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores the watch app’s WKCompanionAppBundleIdentifier for Release builds so it matches the parent iOS app’s CFBundleIdentifier, resolving the App Store Connect/TestFlight Invalid WKCompanionAppBundleIdentifier (409) upload failure while keeping the local-development bundle ID for Debug builds.

Changes:

  • Update INFOPLIST_KEY_WKCompanionAppBundleIdentifier for the Watch app Release configuration to edu.stanford.cs342.2023.balance.
  • Preserve the existing Debug configuration value (com.celteeka.cs342.2023.balance) for local device development.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.23%. Comparing base (e5123f2) to head (b8ba597).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #215   +/-   ##
=====================================
  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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5123f2...b8ba597. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gperissetcelteeka gperissetcelteeka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sebastianricaldoni sebastianricaldoni merged commit 17dff00 into main Jun 11, 2026
6 checks passed
@sebastianricaldoni sebastianricaldoni deleted the bug/BAL-211-SR-fix-game-session-duration-logging branch June 11, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants