Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote Command Error Shows When Successful #2174

Open
gestrich opened this issue Jun 12, 2024 · 1 comment
Open

Remote Command Error Shows When Successful #2174

gestrich opened this issue Jun 12, 2024 · 1 comment

Comments

@gestrich
Copy link
Contributor

Describe the bug

When the app is force killed by the user, and a remote command is delivered (i.e. bolus), it is received twice by Loop. The first one will succeed and be followed by an immediate failure for the second. This is confusing to users as they will see a successful delivery and error in Nightscout.

To Reproduce
Steps to reproduce the behavior:

  1. From dev Loop branch, force close the app.
  2. Send a remote bolus
  3. The bolus will be delivered
  4. Wait 30 seconds - NS will show an error and also a successful bolus deliver at the same time.

Expected behavior

Expected for just 1 bolus to deliver.

Screenshots
If applicable, add screenshots to help explain your problem.

Phone

  • Hardware: iPhone 15
  • OS Version: [e.g. iOS 12.0.1]

Loop Version

  • Version Number: dev
  • Repo: LoopKit/Loop
@gestrich gestrich changed the title Remote Command Error Shows When Succesful Remote Command Error Shows When Successful Jun 12, 2024
@gestrich
Copy link
Contributor Author

The issue is the notification is received both in the app launch options and as a delegate callback.

handleRemoteNotificationFromLaunchOptions
    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
        log.default(#function)

        completionHandler(loopAppManager.handleRemoteNotification(userInfo as? [String: AnyObject]) ? .noData : .failed)
    }

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

No branches or pull requests

1 participant