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

TypeError: Cannot read properties of null (reading 'removeObserver') #2265

Closed
4 tasks done
ildar-shamilov-clearscale opened this issue Jun 1, 2022 · 4 comments
Closed
4 tasks done
Labels
Needs More Information Waiting for more information from builders

Comments

@ildar-shamilov-clearscale

What happened and what did you expect to happen?

After migrating to v3 from v2.

Calling AudioVideoFacade.stop() sometimes throws exception:

LoggerService.ts:89 TypeError: Cannot read properties of null (reading 'removeObserver')
at DefaultAudioVideoController.uninstallPreStartObserver (DefaultAudioVideoController.js:210:1)
at DefaultAudioVideoController. (DefaultAudioVideoController.js:221:1)
at Generator.next ()
at DefaultAudioVideoController.js:10:1
at new Promise ()
at push.../node_modules/amazon-chime-sdk-js/build/audiovideocontroller/DefaultAudioVideoController.js.__awaiter (DefaultAudioVideoController.js:6:1)
at handleClosed (DefaultAudioVideoController.js:218:1)
at Object.handleSignalingClientEvent (DefaultAudioVideoController.js:226:1)
at DefaultSignalingClient.sendEvent (DefaultSignalingClient.js:291:1)
at DefaultSignalingClient.closeEventHandler (DefaultSignalingClient.js:23:1)

Have you reviewed our existing documentation?

Reproduction steps

Calling AudioVideoFacade.stop()

Amazon Chime SDK for JavaScript version

3.2.0

What browsers are you seeing the problem on?

Chrome latest

Browser version

Chrome latest

Meeting and Attendee ID Information.

No response

Browser console logs

LoggerService.ts:89 TypeError: Cannot read properties of null (reading 'removeObserver')
at DefaultAudioVideoController.uninstallPreStartObserver (DefaultAudioVideoController.js:210:1)
at DefaultAudioVideoController. (DefaultAudioVideoController.js:221:1)
at Generator.next ()
at DefaultAudioVideoController.js:10:1
at new Promise ()
at push.../node_modules/amazon-chime-sdk-js/build/audiovideocontroller/DefaultAudioVideoController.js.__awaiter (DefaultAudioVideoController.js:6:1)
at handleClosed (DefaultAudioVideoController.js:218:1)
at Object.handleSignalingClientEvent (DefaultAudioVideoController.js:226:1)
at DefaultSignalingClient.sendEvent (DefaultSignalingClient.js:291:1)
at DefaultSignalingClient.closeEventHandler (DefaultSignalingClient.js:23:1)

@xuesichao
Copy link
Contributor

xuesichao commented Jun 1, 2022

Hi @ildar-shamilov-clearscale , thanks for reporting this issue.

It seems this issue happens because the signalingClient is null. JS SDK initialize a signalingClient instance when calling AudioVIdeoFacade.start() or reconnecting. The signalingClient is set to only when re-connection failed and disconnected.

Could you please provide us more details for your use cases, and how you encountered this issue? If you can find a stable way to reproduce this issue, that would help us a lot.

@xuesichao xuesichao added the Needs More Information Waiting for more information from builders label Jun 1, 2022
@ildar-shamilov-clearscale
Copy link
Author

Probably when i am calling .stop() before .start()

@devalevenkatesh
Copy link
Contributor

@ildar-shamilov-clearscale could you please provide browser console logs for this issue? I tried calling .stop() before .start() but did not ran into any such issue. Seems like the meetingSessionContext.signalingClient is not valid in uninstallPreStartObserver here. I suspect if these two lines race sometime.
https://github.com/aws/amazon-chime-sdk-js/blob/main/src/audiovideocontroller/DefaultAudioVideoController.ts#L737-L738

The uninstallPreStartObserver is called when the signaling client received a close event. Thus it might be happening that the signalingClient.closeConnection triggers the event but the signalingClient is nullified in above two lines.

Created a PR to fix the error. But I think we need console logs to root cause.

@devalevenkatesh
Copy link
Contributor

Closing this issue as we have merged the PR with a fix. Please let me know if you have more issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Information Waiting for more information from builders
Projects
None yet
Development

No branches or pull requests

3 participants