Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/ember/addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export function InitSentryForEmber(_runtimeConfig: BrowserOptions | undefined) {
assert('Missing configuration.', config);
assert('Missing configuration for Sentry.', config.sentry || _runtimeConfig);

const initConfig = Object.assign({}, config.sentry, _runtimeConfig || {});
// Permanently merge options into config, preferring runtime config
Object.assign(config.sentry, _runtimeConfig || {});
const initConfig = Object.assign({}, config.sentry);
Copy link
Contributor

Choose a reason for hiding this comment

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

The only thing that initConfig does now, is shallow clone of config.sentry. And because the only thing you modify is an object (which is assigned by reference), it's effectively 2 objects with the same values (+ _metadata in case of initConfig). I wonder if it wouldn't be simpler to just go directly with config.sentry passed to Sentry.init instead. If you think not, just ignore the comment.


initConfig._metadata = initConfig._metadata || {};
initConfig._metadata.sdk = {
Expand Down