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

iAP transport disconnect cleanup #1248

Merged

Conversation

NicoleYarroch
Copy link
Contributor

@NicoleYarroch NicoleYarroch commented Apr 24, 2019

Fixes #1239, #1261, #1263, #1268

This PR is ready for review.

Risk

This PR makes minor API changes.

Testing Plan

Unit Tests

  • Added test cases for SDLIAPDataSession class
  • Added test cases for SDLIAPControlSession class
  • Fixed test cases in the SDLIAPTransport class

Smoke Testing

  • Smoked tested multisession protocol (data session only) by connecting/disconnecting USB cord.
  • Smoked tested multisession protocol (data session only) by switching between USB and BT transports.
  • Smoked tested control session + data session by connecting/disconnecting USB cord.
  • Smoked tested control session + data session by switching between USB and BT transports.

Summary

  • Fixed accessory not being registered after the USB cord was pulled during the retry delay.
  • Fixed switching between transports after a control session was established not working.
  • Separated the data session and control session logic into their own classes.
  • Fixed a session setup race condition if a stream errors when accessory disconnects. This was an issue when switching between BT and USB transports.

Changelog

Breaking Changes
  • none
Bug Fixes
  • Fixed accessory not being registered after the USB cord was pulled during the retry delay.

Tasks Remaining:

  • Smoke testing

CLA

@NicoleYarroch NicoleYarroch self-assigned this Apr 24, 2019
@NicoleYarroch NicoleYarroch added the bug A defect in the library label Apr 24, 2019
@NicoleYarroch NicoleYarroch changed the title WIP: iAP transport disconnect cleanup iAP transport disconnect cleanup Apr 25, 2019
@NicoleYarroch NicoleYarroch changed the base branch from master to develop April 25, 2019 20:37
@NicoleYarroch NicoleYarroch added this to In progress in v6.3 via automation Apr 25, 2019
@NicoleYarroch NicoleYarroch moved this from In progress to Review in progress in v6.3 Apr 25, 2019
@joeljfischer
Copy link
Contributor

@NicoleYarroch This has some merge conflicts

SmartDeviceLink/SDLIAPControlSession.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPControlSession.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPControlSession.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPControlSession.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPControlSession.h Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPTransport.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPTransport.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPTransport.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPControlSession.h Outdated Show resolved Hide resolved
Example Apps/Example ObjC/ProxyManager.m Outdated Show resolved Hide resolved

__weak typeof(self) weakSelf = self;
void (^elapsedBlock)(void) = ^{
__strong typeof(weakSelf) strongSelf = weakSelf;
Copy link
Contributor

Choose a reason for hiding this comment

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

The protocolIndexTimer should call a selector, not a block. The contents of the block should be moved to a selector, and the index timer updated to call the selector.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you know why the SDLTimer class exists? There is no documentation for that class?

Copy link
Contributor

Choose a reason for hiding this comment

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

It was originally created to make creating and managing an NSTimer's lifecycle easier. It may not be necessary anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think changing/removing the SDLTimer should be a separate PR as the library has had issues with the timer crashing the app in the past. Any changes would need to be extensively smoked tested.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's very true

SmartDeviceLink/SDLIAPControlSession.m Show resolved Hide resolved
SmartDeviceLink/SDLIAPDataSession.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPDataSession.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPTransport.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPTransport.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPTransport.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPTransport.m Outdated Show resolved Hide resolved
SmartDeviceLink/SDLIAPTransport.m Outdated Show resolved Hide resolved
NicoleYarroch and others added 10 commits May 31, 2019 11:26
Refactored the stream errored on write in data session class
Fixed SDL log spelling

Co-Authored-By: Joel Fischer <joeljfischer@gmail.com>
Refactored the create session methods in iAPTransport class
…' of https://github.com/smartdevicelink/sdl_ios into bugfix/issue_1239_iAPTransport_class_disconnect_cleanup

# Conflicts:
#	SmartDeviceLink/SDLIAPTransport.m
v6.3 automation moved this from Review in progress to Reviewer approved Jun 4, 2019
@joeljfischer joeljfischer merged commit e16e360 into develop Jun 4, 2019
v6.3 automation moved this from Reviewer approved to Done Jun 4, 2019
@joeljfischer joeljfischer deleted the bugfix/issue_1239_iAPTransport_class_disconnect_cleanup branch June 4, 2019 18:57
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.3
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants