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

fix: nested object in options are shared across multiple instances #559

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

kevinpagtakhan
Copy link
Contributor

@kevinpagtakhan kevinpagtakhan commented Oct 25, 2022

Summary

Creates clone of nested objects in DEFAULT_OPTIONS to break sharing of references to these nested objects

Testing

const a = amplitude.getInstance('a')
> undefined
const a = amplitude.getInstance('a')
> undefined
a.options.plan === b.options.plan
> false
a.options.library === b.options.library
> false
a.options.headers === b.options.headers
> false
a.options.ingestionMetadata === b.options.ingestionMetadata
> false

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

@kevinpagtakhan kevinpagtakhan requested review from liuyang1520 and a team October 25, 2022 18:05
@kevinpagtakhan kevinpagtakhan self-assigned this Oct 25, 2022
@kevinpagtakhan kevinpagtakhan merged commit 5129c45 into main Oct 25, 2022
@kevinpagtakhan kevinpagtakhan deleted the DXOC-240 branch October 25, 2022 18:28
github-actions bot pushed a commit that referenced this pull request Oct 25, 2022
## [8.21.2](v8.21.1...v8.21.2) (2022-10-25)

### Bug Fixes

* nested object in options are shared across multiple instances ([#559](#559)) ([5129c45](5129c45))
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

4 participants