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

Check waypoint subscription size in resumption #3684

Merged
merged 2 commits into from
Apr 9, 2021

Conversation

Jack-Byrne
Copy link
Collaborator

Fixes #3683

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

See reproduction steps in issue #3683

Summary

Check size of waypoint subscription list before unsubscribing HMI from way points.

CLA

@@ -131,14 +131,19 @@ void SDLRPCPlugin::RevertResumption(application_manager::Application& app) {
pending_resumption_handler_->OnResumptionRevert();

if (application_manager_->IsAppSubscribedForWayPoints(app)) {
application_manager_->UnsubscribeAppFromWayPoints(app.app_id());
if (!application_manager_->IsAnyAppSubscribedForWayPoints()) {
std::set<uint32_t> subscribed_apps =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JackLivio probably good place for const auto

if (!application_manager_->IsAnyAppSubscribedForWayPoints()) {
std::set<uint32_t> subscribed_apps =
application_manager_->GetAppsSubscribedForWayPoints();
bool send_unsubscribe = subscribed_apps.size() <= 1 &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JackLivio const bool?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JackLivio do we really need to check "less than one"?

Suggested change
bool send_unsubscribe = subscribed_apps.size() <= 1 &&
bool send_unsubscribe = subscribed_apps.size() == 1 &&

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AKalinich-Luxoft Updated the modifiers, but I would suggest keeping <= for "safety".

@Jack-Byrne Jack-Byrne merged commit 5f9cbdf into release/7.1.0-RC1 Apr 9, 2021
@Jack-Byrne Jack-Byrne deleted the fix/issue_3683 branch April 9, 2021 13:08
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

Successfully merging this pull request may close these issues.

3 participants