Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions LoopFollow/LiveActivity/LiveActivityManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,20 @@ final class LiveActivityManager {
// • the user disables LA or calls forceRestart
LogManager.shared.log(category: .general, message: "[LA] activity cleared id=\(activity.id) state=\(state)", isDebug: true)
}
if state == .ended, wasCurrentActivity, !endingForRestart {
// iOS terminated the activity itself — typically the ~8h lifetime
// cap reached before renewal fired. The .dismissed path below
// already handles iOS-initiated dismissals via renewalFailed /
// pastDeadline, but .ended bypasses that branch entirely. Without
// a signal here, handleForeground() sees `renewalFailed=false` and
// `renewBy` still in the future, returns "no action needed", and
// startIfNeeded keeps re-binding the corpse — the LA stays dark
// until the user manually force-restarts. Mark renewalFailed so
// the next foreground entry runs performForegroundRestart, which
// sweeps any leftover ended activity and pushes a fresh one.
Storage.shared.laRenewalFailed.value = true
LogManager.shared.log(category: .general, message: "[LA] ended by iOS (not our restart) — marked renewalFailed=true, auto-restart on next foreground")
}
if state == .dismissed {
// Three possible sources of .dismissed — only the third blocks restart:
//
Expand Down
Loading