-
Notifications
You must be signed in to change notification settings - Fork 369
Remote PR Set #3 #488
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 PR Set #3 #488
Conversation
*/ | ||
func commandFromPushNotification(_ notification: [String: AnyObject]) async throws -> RemoteCommand | ||
func handleRemoteNotification(_ notification: [String: AnyObject]) async throws | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REMOTE 2.0: WILL REMOVE PRE-MERGE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "handle" is one of those non-descriptive verbs, like "process". Every function "handles" something or "processes" something. Maybe something like remoteNotificationWasReceived(_ notification ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
func handleRemoteOverride(name: String, durationTime: TimeInterval?, remoteAddress: String) async throws | ||
func handleRemoteOverrideCancel() async throws | ||
func handleRemoteCarb(amountInGrams: Double, absorptionTime: TimeInterval?, foodType: String?, startDate: Date?) async throws | ||
func handleRemoteBolus(amountInUnits: Double) async throws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REMOTE 2.0: WILL REMOVE PRE-MERGE
// | ||
|
||
import Foundation | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RemoteActionDelegate
is conformed to both by the ServiceManager and DeviceDataManager to propogate actions to where they are delivered.
I'm using "handleRemote" in the method names to help disambiguate from existing APIs in DeviceDataManaager, like "enactBolus". I can drop the prefix if desired though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, "handle" is very vague. This API is exposing dosing functionality and settings change functionality. So it would be more descriptive to have the verbs describe actually enacting or delivering. I think it's fine to keep the "remote" in there, as that's the main foreseeable use for this API, but an API like this could theoretically be used by Services for other things, like maybe they have some kind of other trigger to change dosing, like a timer, or other notification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done but let me know if feedback on the names below.
a82acc8
to
98070db
Compare
MockKit/MockService.swift
Outdated
throw MockServicePushNotificationError.remoteCommandsNotSupported | ||
public func handleRemoteNotification(_ notification: [String: AnyObject]) async throws { | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REMOTE 2.0: WILL REMOVE PRE-MERGE
98070db
to
cb3f748
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This is part of a collection of foundational PRs that need to merge at the same time.
Loop
LoopKit
NightscoutService
TidepoolService