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

Adding missing conditional check to stop the manager if SDLAppInterfa… #1223

Merged

Conversation

justingluck93
Copy link
Contributor

@justingluck93 justingluck93 commented Apr 5, 2019

Fixes #1097 WIP

This PR is ready for review.

Risk

This PR makes no API changes.

Summary

Added protocol violation check to the if conditional to stop the manager

CLA

…ceUnregisteredReason is PROTOCOL_VIOLATION
@NicoleYarroch NicoleYarroch self-requested a review April 5, 2019 13:36
@NicoleYarroch NicoleYarroch added the bug A defect in the library label Apr 5, 2019
@NicoleYarroch NicoleYarroch added this to In progress in v6.2.0 via automation Apr 5, 2019
@NicoleYarroch NicoleYarroch added this to the 6.2.0 milestone Apr 5, 2019
@NicoleYarroch
Copy link
Contributor

I can still reproduce the bug when connecting to sdl_core.

  1. Connect SDL_iOS swift example app to sdl_core (v. 5.1.0) + sdl_hmi (develop).
  2. Open the menu on the sdl app and select the "Exit 'UNAUTHORIZED_TRANSPORT_REGISTRATION'" menu item. This will send an OnAppInterfaceUnregistered RPC with a reason code of APP_UNAUTHORIZED.
  3. The app will disconnect and then automatically reconnect to Core.

The issue is that the SDLProxy class is intercepting the OnAppInterfaceUnregistered RPC and sending a SDLTransportDidDisconnect notification before it broadcasts the OnAppInterfaceUnregistered RPC. The SDLLifecycleManager gets the SDLTransportDidDisconnect notification first and then the OnAppInterfaceUnregistered notification when it should be the other way around.

To fix this, in the handleRPCDictionary: method of the SDLProxy class, move:

if ([functionName isEqualToString:SDLRPCFunctionNameOnAppInterfaceUnregistered] || [functionName isEqualToString:SDLRPCFunctionNameUnregisterAppInterface]) {
    [self handleRPCUnregistered:dict];
}

to after this line:

[self sdl_invokeDelegateMethodsWithFunction:functionName message:newMessage];

v6.2.0 automation moved this from In progress to Needs review Apr 5, 2019
Copy link
Contributor

@NicoleYarroch NicoleYarroch left a comment

Choose a reason for hiding this comment

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

I can still reproduce the issue. I left a comment with instructions on how to reproduce and with some steps you can take to investigate the issue.

@justingluck93
Copy link
Contributor Author

justingluck93 commented Apr 5, 2019

This PR is just to get the check inside the LifeCycle it does not completely fix the issue yet. The underlining issue is still being investigated. I will use your steps and see if I can track down a fix.

@joeljfischer joeljfischer merged commit 583cde9 into develop Apr 5, 2019
v6.2.0 automation moved this from Needs review to Done Apr 5, 2019
@joeljfischer joeljfischer deleted the bugfix/issue-1097-Add-Missing-ProtocolViolationCheck branch April 5, 2019 18:09
@joeljfischer joeljfischer mentioned this pull request Apr 5, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
No open projects
v6.2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants