Skip to content

Merge context with the same key instead of replacing the old value.#1621

Merged
st0012 merged 3 commits intomasterfrom
fix-#1619
Nov 19, 2021
Merged

Merge context with the same key instead of replacing the old value.#1621
st0012 merged 3 commits intomasterfrom
fix-#1619

Conversation

@st0012
Copy link
Copy Markdown
Contributor

@st0012 st0012 commented Nov 19, 2021

Before:

Sentry.set_context(:character, { name: "John" })
Sentry.set_context(:character, { age: 25 })
p Sentry.get_current_scope.contexts[:character] #=> {:age=>25}

After:

Sentry.set_context(:character, { name: "John" })
Sentry.set_context(:character, { age: 25 })
p Sentry.get_current_scope.contexts[:character] #=> {:age=>25, :name=>"John"}

Closes #1619

@st0012 st0012 requested a review from sl0thentr0py November 19, 2021 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should set_context with the same context name clobber existing values?

2 participants