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

bug: fix unsafe usage of static variables #4664

Merged
merged 10 commits into from
Jul 17, 2024
Merged

Conversation

nabati
Copy link
Contributor

@nabati nabati commented Jul 12, 2024

Type of change

Description 📝

TLDR: We're using unsafe static variables to keep state. The issue is that if there are multiple instances of the viewer, then they will end up overwriting each other and we get bugs.

Threads:
https://cognitedata.slack.com/archives/C8A0QGMLN/p1720636595411859
https://cognitedata.slack.com/archives/C8A0QGMLN/p1720612784051089

I guess this would be a breaking change FYI.

How has this been tested? 🔍

Locally nothing breaks. Could use some help with validating this though.

Test instructions ℹ️

Checklist ☑️

@nabati nabati requested a review from a team as a code owner July 12, 2024 10:59
Base automatically changed from pn/use-v4-yarn-for-examples to master July 15, 2024 12:21
Copy link
Contributor

@haakonflatval-cognite haakonflatval-cognite left a comment

Choose a reason for hiding this comment

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

Looks good! A few comments

viewer/packages/camera-manager/src/types.ts Outdated Show resolved Hide resolved
viewer/packages/camera-manager/src/CameraManagerHelper.ts Outdated Show resolved Hide resolved
examples/src/utils/CustomCameraManager.ts Outdated Show resolved Hide resolved
Copy link

There were failures in the visual tests workflow.
Image diffs for visual tests can be downloaded as an artifact here.

Copy link
Contributor

@haakonflatval-cognite haakonflatval-cognite left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@nabati nabati enabled auto-merge (squash) July 16, 2024 13:48
@nabati nabati merged commit 4367077 into master Jul 17, 2024
14 checks passed
@nabati nabati deleted the pn/fix-unsafe-static-variables branch July 17, 2024 08:08
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.

2 participants