Skip to content

fix(video360): prevent teardown crash when closing 360 video preview#1692

Merged
zhirongwang merged 1 commit into
box:masterfrom
zhirongwang:zhirongwang/preview-1008-fix-video360-teardown
Jul 7, 2026
Merged

fix(video360): prevent teardown crash when closing 360 video preview#1692
zhirongwang merged 1 commit into
box:masterfrom
zhirongwang:zhirongwang/preview-1008-fix-video360-teardown

Conversation

@zhirongwang

@zhirongwang zhirongwang commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Separate 360 controls into video360Controls so teardown no longer calls removeListener() on DashViewer's React ControlsRoot
  • Tear down 360 controls before super.destroy() to avoid double-destroy and early-unmount crashes
  • Add regression test for destroy when only React controls are present
    Fixes PREVIEW-1008

Test plan

  • NODE_ENV=test yarn jest src/lib/viewers/box3d/video360/__tests__/Video360Viewer-test.js
  • Open a .360.mp4, close/navigate away before viewer fully loads — no console TypeError
  • Open a .360.mp4, wait for interactive viewer, then close — clean teardown
  • Back button from 360 preview returns to folder listing (no "Oops" page)

@zhirongwang zhirongwang requested a review from a team as a code owner July 2, 2026 19:07
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


zhirongwang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@zhirongwang zhirongwang self-assigned this Jul 2, 2026

@aivkov123 aivkov123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@zhirongwang zhirongwang force-pushed the zhirongwang/preview-1008-fix-video360-teardown branch from 11b8fea to 7663264 Compare July 7, 2026 18:18
@zhirongwang zhirongwang merged commit b03ddc7 into box:master Jul 7, 2026
6 of 7 checks passed
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.

4 participants