Skip to content

two active overrides when activating a second one from watch #1763

Description

@Joerg-Schoemer

Describtion
Two active overrides causes the loop to crash.
We had an active override for a lazy day and jumped into the car. While activating the car-override with the watch we'd two active overrides which leads to crash the loop:

        guard invalidOverrideIndices.isEmpty else {
            // Save the invalid event history for debugging.
            taintedEventLog = recentEvents

            // Wipe only conflicting overrides to retain as much history as possible.
            recentEvents.removeAll(at: invalidOverrideIndices)

            // Crash deliberately to notify something has gone wrong.
            preconditionFailure("No overrides should overlap.")
        }

We had no chance to get the loop running. The main view shows up for a second but disappears suddenly and no loop was in the active app list.

To Reproduce
Steps to reproduce the behavior:

  1. Go to override menu on the phone
  2. Click on an override to activate
  3. Switch to a watch and activate an other override with an overlapping interval
  4. Loop won't come up anymore

Expected behavior
When activating a new override from the watch deactivate the active one before.

Screenshots
Bildschirmfoto 2022-08-01 um 22 46 50

Hardware

  • Hardware: iPhone 7; Watch S7
  • OS Version: iOS 15.5; watchOS 8.7

Loop Version

  • Version Number: 2.3.0.57
  • Repo: LoopKit/Loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions