Skip to content

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

Merged
kevinpagtakhan merged 2 commits into
mainfrom
DXOC-240
Oct 25, 2022
Merged

fix: nested object in options are shared across multiple instances#559
kevinpagtakhan merged 2 commits into
mainfrom
DXOC-240

Conversation

@kevinpagtakhan
Copy link
Copy Markdown
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 a team and liuyang1520 October 25, 2022 18:05
@kevinpagtakhan kevinpagtakhan self-assigned this Oct 25, 2022
Comment thread src/amplitude-client.js
Comment thread src/amplitude-client.js
Comment thread src/amplitude-client.js
@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.

4 participants