-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Remote PR Set #3 #2009
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
Merged
ps2
merged 15 commits into
LoopKit:dev
from
gestrich:feature/2023/06/bg/remote-command-service-refactor
Jul 2, 2023
Merged
Remote PR Set #3 #2009
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
10e58b7
Remote handling rearchitecture
gestrich 89f2293
Move remote background handling to ServicesManager.
gestrich 36b0c94
Add delegate for ServicesManager
gestrich fb6a375
Remove remote details from DeviceDataManager
gestrich e3a2627
Remove remote terms from ServicesManagerDelegate api
gestrich 47fa03b
Respond only to loopFinished notifications
gestrich 82b05a7
Remove unused method
gestrich c598114
Rename method
gestrich 1826af8
Update names
gestrich deb021e
Update names
gestrich b4209dc
Remove more remote references in DeviceDataManager
gestrich cca2741
Remove Remote 2.0 parts
gestrich 5988cdb
Update enact override method name
gestrich 52f143e
Move validation to ServicesManager.
gestrich b30bef9
Move bolus validation to ServicesManager
gestrich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
This allows the
DeviceDataManagerto handle actions for theServicesManager-- via a newRemoteCommandHandlerprotocol. When a plugin sends an action to the ServicesManager, it needs to get that action to the DeviceDataManager.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.
DeviceDataManager already exposes methods for dosing. Does it need separate methods for "remote" dosing? If so, why?
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.
I'm wondering how
ServicesManagercan communicate withDeviceDataManager, assumingDeviceDataManageris still where dosing/settings things will live. Right now there is not a reference I see going that direction. So this delegate provides a bridge for theServicesManagerManagerto talk to theDeviceDataManagerto enact doses, change settings, etc.Is it the delegate name of
RemoteActionDelegatethat I should change? LikeDeviceDataManagerDelegate?Uh oh!
There was an error while loading. Please reload this page.
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.
Or were you thinking these remote things be relocated to
RemoteDataServicesManager? (dosing, settings)? (That's another place where the reference goes fromDeviceDataManager->RemoteDataServicesManagerbut not the other way around. )We also need to think about where incoming push notifications are handled as well, if we are moving all these, as those need to be propogated back to the
ServicesManagertoo.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.
ServicesManagerwill still need to communicate withDeviceDataManagerfor dosing. But it should only be for dosing. I don't think DeviceDataManager needs to know about anything "remote".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.
Ok I'll look at keeping the delegate, as we still need a bridge between these classes, but I'll rename it -- maybe
ServicesManagerDelegate(I had the delegation relationship backwards in my prior comment).Then I'll remove as much of the remote things from DeviceDataManager into the
ServicesManagerorRemoteDataServicesManager.Do you want these changes as part of this PR set or a future one? This change seems big enough that it may be easier to test/review separately from all this. Whatever you prefer.
Uh oh!
There was an error while loading. Please reload this page.
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.
I documented the relationships between these managers to get the big picture of how this update will fit. A few notes on the plans for this update:
RemoteActionDelegate, implemented byDeviceDataManagerin this PR, will be renamed toServicesManagerDelegate(red line in diagram). That will be for dosing/settings updates. I'll rename the delegate methods to drophandleRemotefrom prefix.DeviceDataManagerto remove any 'Remote' phraseology to be consistent with the rest of this rearchitecture. I plan to not change anything else in those methods, including remote trigger uploads and analytics uploads (will stay inDeviceDataManager)DeviceDataManagertoServicesManager.handleRemoteNotificationfromDeviceDataManagertoServicesManager.Uh oh!
There was an error while loading. Please reload this page.
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.
@ps2 I've made the changes that I describe in the last comment and pushed to this branch. Let me know if this is what you are looking for.
Note there is a still the
RemoteActionDelegate(not represented in this diagram) that lives between theRemoteDataServicesandServicesManager. Then there is the new delegate betweenServicesManagerandDeviceDataManagerwhich has no references to "Remote" like you mentioned.I have not adjusted the naming in
RemoteActionDelegateper your comments in the LoopKit PR. I'll look at that separately. I think that is the last of your feedback thus far.