Skip to content

Commit

Permalink
ref(ember): Fix merging of runtime config with environment config. (#…
Browse files Browse the repository at this point in the history
…3563)

Runtime config initially was meant to act as an override, but moving forward we want to be able to support it accepting the usual Sentry init config so that passing functions is possible.
  • Loading branch information
k-fish authored May 19, 2021
1 parent 9226ba2 commit c7d9d83
Showing 1 changed file with 3 additions and 1 deletion.
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);

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

0 comments on commit c7d9d83

Please sign in to comment.