Skip to content

Conversation

@joeygrover
Copy link
Member

Fixes #1703

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

  • I have verified that I have not introduced new warnings in this PR (or explain why below)
  • I have run the unit tests with this PR
  • I have tested this PR against Core and verified behavior (if applicable, if not applicable, explain why below).
  • I have tested Android

Core Tests

This race condition is difficult to reproduce. The main tests should be that the legacy mode continues to work. Also have the library close the connection to ensure that still works at closing the connection properly.

Summary

There was a possible race condition where two sections of code could modify the legacy transport and set it to null. This could cause NPEs to occur even after null checks. The code was refactored a little to simple call into the synchronous method that exits out of legacy mode. This means the only time the legacy transport is created or set to null will be in the synchronized enter and exit legacy mode methods.

Changelog

Bug Fixes
  • Should fix chance of a race condition modifying same variable to cause NPE

CLA

@codecov
Copy link

codecov bot commented Jun 2, 2021

Codecov Report

Merging #1704 (8f44c51) into develop (889058f) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1704      +/-   ##
=============================================
+ Coverage      54.22%   54.24%   +0.01%     
- Complexity      5351     5355       +4     
=============================================
  Files            555      555              
  Lines          24622    24622              
  Branches        3122     3122              
=============================================
+ Hits           13351    13355       +4     
+ Misses         10111    10108       -3     
+ Partials        1160     1159       -1     
Impacted Files Coverage Δ
...managers/screen/TextAndGraphicUpdateOperation.java 71.42% <0.00%> (+0.27%) ⬆️
...ink/managers/screen/BaseTextAndGraphicManager.java 64.16% <0.00%> (+0.41%) ⬆️
...nk/managers/audio/AudioDecoderCompatOperation.java 79.54% <0.00%> (+4.54%) ⬆️

@JulianKast JulianKast merged commit 08737a9 into develop Jun 2, 2021
@JulianKast JulianKast deleted the bugfix/issue_1703 branch June 2, 2021 15:24
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