-
Notifications
You must be signed in to change notification settings - Fork 89
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
[scd] properly cleanup implicit sub on oir update #1104
Merged
mickmis
merged 1 commit into
interuss:master
from
Orbitalize:fix-implicit-sub-oir-update-clean
Sep 9, 2024
Merged
Changes from all commits
Commits
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 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.
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 looks like a sanity check: return an error if subscription is nil. It does not make sense invoking that function with a nil subscription.
Or remove the check altogether since it is private and use twice where a non-nil check is already performed.
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.
nil
when the state of an OIR is 'accepted' so receiving a nil here does not necessarily indicate a problemMy intent of having the check here was probably to avoid the extra checks in the caller, but conciseness consideration taken aside:
I may have originally called the method
subscriptionNeedsCleanup
: at that time the early return withfalse
would fit pretty well with the method name. But even now, if a subscription does not exist it feels Ok to just return false, as a non-existing subscription can't be implicit or attached to the OIR?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.
Looking at the context where this method is called, I feel like moving the check out of it will not bring any benefits: I'd rather leave it as-is, especially knowing that an upcoming PR is going to remove this code.
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 guess that's a possible interpretation, but then I'd say that the root issue here is that the abstraction defined by this function is a bit awkward. Not a huge issue in itself here though.
As long as we are not silencing errors I'm OK, and looks like it's not the case here.
Is this actually planned for?
(but not a valid reason anyway)
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.
Yes, in #1059 and it's part of the work we'd like to possibly get done until the 14th