Skip to content

Fix does not send UnsubscribeVehicleData request to HMI after last unregister app.#2

Open
IGapchuk wants to merge 3 commits intobranch_4.2.1from
4.2.1.fix/sdl_not_send_UnsubscribeVehicleData
Open

Fix does not send UnsubscribeVehicleData request to HMI after last unregister app.#2
IGapchuk wants to merge 3 commits intobranch_4.2.1from
4.2.1.fix/sdl_not_send_UnsubscribeVehicleData

Conversation

@IGapchuk
Copy link
Owner

@IGapchuk IGapchuk commented Sep 1, 2018

Fixes 2282

This PR is ready for review.

Risk

This PR makes no API changes.

Summary

When last application unregistered, SDL was not sending to HMI UnsubscribeVehicleData request.

This PR provides fix for that defect: when application unregister , SDL checks for exists other registered applications. If they exist, SDL compares their subscriptions for VehicleDataInfo with subscription of unregister application.
If unregister application only itself subscribe to some VehicleDataInfo, that VehicleDataInfo type will be added for unsubscribing.
If unregister application subscribed for some VehicleDataInfo and some register application subscribed for same VehicleDataInfo, that VehicleDataInfo will not added to unsubscribe.
When checking will be finished and all VehicleDataInfo for unregistering have collected, SDL sends to HMI UnsubscribeVehicleData request.

CLA

@IGapchuk IGapchuk changed the base branch from master to branch_4.2.1 September 1, 2018 11:27
Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk i think there should be a return statement here, otherwise command->Init() or command->Run() below may result in a crash

Copy link
Owner Author

@IGapchuk IGapchuk Sep 3, 2018

Choose a reason for hiding this comment

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

@mked-luxoft That changes was revert.

#include <utility>
#include <map>
#include <memory>
#include <utility>
Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk is memory header needed here?

Copy link
Owner Author

Choose a reason for hiding this comment

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

@mked-luxoft Fixed in 36b0ead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk any reasons to pass shared pointer by reference? Also please take a look at typedef ApplicationConstSharedPtr

Copy link
Owner Author

@IGapchuk IGapchuk Sep 3, 2018

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk first param also could be const

Copy link
Owner Author

@IGapchuk IGapchuk Sep 3, 2018

Choose a reason for hiding this comment

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

static smart_objects::SmartObjectList CreateAddCommandRequestToHMI(
ApplicationConstSharedPtr app, ApplicationManager& app_mngr);

static smart_objects::SmartObjectSPtr CreateMessageForHMI(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk please provide description for this function

Copy link
Owner Author

@IGapchuk IGapchuk Sep 3, 2018

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk any reasons to pass shared pointer by reference?

Copy link
Owner Author

@IGapchuk IGapchuk Sep 3, 2018

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk could be const

Copy link
Owner Author

@IGapchuk IGapchuk Sep 3, 2018

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk why just don't use ManageHMICommand(message_to_hmi) call?


void VIUnsubscribeVehicleDataRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk not related changes

Copy link
Owner Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk suggest to use more descriptive names like message_so and message_ref

Copy link
Owner Author

Choose a reason for hiding this comment

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

commands::Command::CommandOrigin origin,
ApplicationManager& application_manager) {
CommandSharedPtr command;

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk unrelated changes

Copy link
Owner Author

Choose a reason for hiding this comment

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

@AKalinich-Luxoft Reverted in 36b0ead.

hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered;

message[strings::params][strings::message_type] = MessageType::kNotification;
// we put hmi_app_id because applicaton list does not contain application on
Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk unrelated changes

Copy link
Owner Author

@IGapchuk IGapchuk Sep 3, 2018

Choose a reason for hiding this comment

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

@AKalinich-Luxoft Reverted in 36b0ead.

static smart_objects::SmartObjectList CreateAddCommandRequestToHMI(
ApplicationConstSharedPtr app, ApplicationManager& app_mngr);

static smart_objects::SmartObjectSPtr CreateMessageForHMI(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk i think some sort of a short description is lacking here

Copy link
Owner Author

@IGapchuk IGapchuk Sep 3, 2018

Choose a reason for hiding this comment

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

@mked-luxoft Added in 36b0ead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@IGapchuk minor thing, but i suppose it's better to make this variable const, since we do not modify it anywhere below

Copy link
Owner Author

Choose a reason for hiding this comment

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

@mked-luxoft That changes was revert.

@IGapchuk IGapchuk force-pushed the 4.2.1.fix/sdl_not_send_UnsubscribeVehicleData branch 2 times, most recently from 11b0429 to 5e67cdc Compare September 3, 2018 12:21
@AByzhynar
Copy link
Collaborator

@IGapchuk Check destination branch and repo

@AByzhynar
Copy link
Collaborator

@IGapchuk Your branches names are invalid

@AByzhynar
Copy link
Collaborator

@IGapchuk Update PR description with detailed info where is the problem and why do you think your fix solves it.

@AByzhynar
Copy link
Collaborator

@IGapchuk Any updates?

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.

5 participants

Comments