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

Should shutdown unset _fs_initialized? #108

Open
quisido opened this issue Nov 17, 2021 · 0 comments
Open

Should shutdown unset _fs_initialized? #108

quisido opened this issue Nov 17, 2021 · 0 comments

Comments

@quisido
Copy link

quisido commented Nov 17, 2021

I have a React useEffect hook that calls init() on mount. There is currently no cleanup function to un-initialize FullStory.

When this React component mounts, it initialized FullStory (expected behavior).

If this component unmounts, then remounts, it emits a console warning that FullStory has already been initialized and not to initialize it again.

This is fair. In the live app, this component doesn't unmount. However, in unit tests, the application mounts and unmounts multiple times when testing behavior. As a result, this component mounts, initializes FullStory ✅, runs a test, unmounts, then mounts, initializes FullStory ⚠ (warning), runs a test, unmounts.

I checked into adding shutdown as a cleanup step, but it does not appear as if shutdown resets the _fs_initalized variable.

Any advice?

Is "unset _fs_initialized in shutdown" a valid feature request here?

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

No branches or pull requests

1 participant