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

[expo-av] Prevent debugger from breaking when removing observations #9334

Merged
merged 5 commits into from
Jul 21, 2020

Conversation

IjzerenHein
Copy link
Contributor

@IjzerenHein IjzerenHein commented Jul 21, 2020

Why

Debugging the native expo-av iOS code causes the debugger to break 10+ times and often break the debugger connection. This makes it difficult and time consuming to run/debug the expo-av code in XCode.

To reproduce

  • Run Expo client in XCode
  • Open NCL and go to API -> Audio
  • Debugger breaks 10+ times

image

How

  • Remove the need for try/catch by keeping track of observations

Test Plan

  • Debugged the code to verify observations are added/removed as expected
  • Verified NCL examples work as expected
  • Implemented a test observation counter to verify all observations are removed when loading and unloading the AV ncl page
2020-07-21 10:02:33.872108+0200 Exponent[87611:9714297] removeObserver, count: 1
2020-07-21 10:02:33.876903+0200 Exponent[87611:9714297] removeObserver, count: 0
2020-07-21 10:02:33.879505+0200 Exponent[87611:9714297] addObserver, count: 1
2020-07-21 10:02:33.880758+0200 Exponent[87611:9714297] addObserver, count: 2
2020-07-21 10:02:33.895799+0200 Exponent[87611:9714297] addObserver, count: 3
2020-07-21 10:02:33.896934+0200 Exponent[87611:9714297] addObserver, count: 4
2020-07-21 10:02:33.897729+0200 Exponent[87611:9714297] addObserver, count: 5
2020-07-21 10:02:33.901118+0200 Exponent[87611:9714296] removeObserver, count: 1
2020-07-21 10:02:33.902712+0200 Exponent[87611:9714296] removeObserver, count: 0
2020-07-21 10:02:33.903667+0200 Exponent[87611:9714296] addObserver, count: 1
2020-07-21 10:02:33.903851+0200 Exponent[87611:9714296] addObserver, count: 2
2020-07-21 10:02:33.904308+0200 Exponent[87611:9714296] addObserver, count: 3
2020-07-21 10:02:33.904715+0200 Exponent[87611:9714296] addObserver, count: 4
2020-07-21 10:02:33.905015+0200 Exponent[87611:9714296] addObserver, count: 5
2020-07-21 10:02:34.074593+0200 Exponent[87611:9714275] [] nw_endpoint_flow_copy_multipath_subflow_counts Called on non-Multipath connection
2020-07-21 10:02:34.235564+0200 Exponent[87611:9714297] [] nw_endpoint_flow_copy_multipath_subflow_counts Called on non-Multipath connection
2020-07-21 10:02:47.535364+0200 Exponent[87611:9714275] removeObserver, count: 4
2020-07-21 10:02:47.535507+0200 Exponent[87611:9714275] removeObserver, count: 3
2020-07-21 10:02:47.535587+0200 Exponent[87611:9714275] removeObserver, count: 2
2020-07-21 10:02:47.535664+0200 Exponent[87611:9714275] removeObserver, count: 1
2020-07-21 10:02:47.535733+0200 Exponent[87611:9714275] removeObserver, count: 0
2020-07-21 10:02:47.540880+0200 Exponent[87611:9714275] removeObserver, count: 4
2020-07-21 10:02:47.541221+0200 Exponent[87611:9714275] removeObserver, count: 3
2020-07-21 10:02:47.541543+0200 Exponent[87611:9714275] removeObserver, count: 2
2020-07-21 10:02:47.541878+0200 Exponent[87611:9714275] removeObserver, count: 1
2020-07-21 10:02:47.542155+0200 Exponent[87611:9714275] removeObserver, count: 0

@github-actions
Copy link
Contributor

Native Component List for this branch is ready

Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

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

LGTM 👍

packages/expo-av/ios/EXAV/EXAVPlayerData.m Outdated Show resolved Hide resolved
@IjzerenHein IjzerenHein merged commit 77bc969 into master Jul 21, 2020
@IjzerenHein IjzerenHein deleted the @hein/expo-av/playerdata-observers branch July 21, 2020 18:06
@IjzerenHein
Copy link
Contributor Author

IjzerenHein commented Jul 22, 2020

Somehow these changes seem to have broken Looping on iOS.

I'm going to revert this for now.
EDIT: Looking into this, might have found the cause
EDIT: Found the issue, fix has been committed to master

IjzerenHein added a commit that referenced this pull request Jul 22, 2020
Jamedjo pushed a commit to Jamedjo/expo that referenced this pull request Feb 4, 2021
…xpo#9334)

* [expo-av] Prevent debugger from breaking when removing observations

* [expo-av] Remove obversation debug ref count

* [expo-av] Update changelog

* Update packages/expo-av/ios/EXAV/EXAVPlayerData.m

Co-authored-by: Bartłomiej Bukowski <bartlomiejbukowski.b@gmail.com>

Co-authored-by: Bartłomiej Bukowski <bartlomiejbukowski.b@gmail.com>
Jamedjo pushed a commit to Jamedjo/expo that referenced this pull request Feb 4, 2021
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.

None yet

3 participants