From a5ba88bee2d768ceb7dcf910ff4316889fb8d080 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Mon, 6 Jul 2026 14:04:38 -0700 Subject: [PATCH] Launch Activity Logic Nucleic-Session: EBB24271-3AB2-4CBD-A47A-59FC73500371 Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/LiveActivityManager.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NucleicRemote/NucleicRemote/LiveActivityManager.swift b/NucleicRemote/NucleicRemote/LiveActivityManager.swift index 14b2c9b..73dddd9 100644 --- a/NucleicRemote/NucleicRemote/LiveActivityManager.swift +++ b/NucleicRemote/NucleicRemote/LiveActivityManager.swift @@ -195,6 +195,12 @@ final class LiveActivityManager { /// bridge setup; the guards keep a single observer each. func beginPushToStartObservation() { guard ActivityAuthorizationInfo().areActivitiesEnabled else { return } + // Grab an activity that already exists when we start observing — e.g. one a Mac push-started + // while the app was closed, which won't re-emit through `activityUpdates` for a late observer. + // This is what lets a background "adopt" wake harvest and forward its update token. + if activity == nil, let existing = Activity.activities.first { + adopt(existing) + } if pushToStartObservation == nil { pushToStartObservation = Task { [weak self] in for await data in Activity.pushToStartTokenUpdates {