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

Local context is overwritten by Observation instrumentation #774

Closed
bclozel opened this issue Aug 16, 2023 · 1 comment
Closed

Local context is overwritten by Observation instrumentation #774

bclozel opened this issue Aug 16, 2023 · 1 comment
Assignees
Labels
in: core Issues related to config and core support type: bug A general bug
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Aug 16, 2023

This is a backport of #761 (and its original issue #760).

@bclozel bclozel added type: bug A general bug in: core Issues related to config and core support labels Aug 16, 2023
@bclozel bclozel added this to the 1.1.6 milestone Aug 16, 2023
@bclozel bclozel self-assigned this Aug 16, 2023
bclozel pushed a commit that referenced this issue Aug 16, 2023
Prior to this commit, a `DataFetcher` instrumented by the
`GraphQlObservationInstrumentation` would incorrectly overwrite the
local context when:

* the `DataFetcher` returns a value object (i.e. not a
  `DataFetcherResult`)
* the given `DatFetchingEnvironment` has an existing local context
with values

For this case, the instrumentation would create a new local context but
would not inherit from the existing local context.

See gh-774
bclozel added a commit that referenced this issue Aug 16, 2023
This commit also ensures that a new local context is created, copying
the existing values. This avoids mutating the parent local context and
polluting it with local values.
This could cause unintended side effects on other child datafetchers.

Fixes gh-774
@github-actions
Copy link
Contributor

Fixed via c5f1e5f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues related to config and core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant