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

Fix trace context lost when squashing and rethrowing GQL errors #1191

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

myieye
Copy link
Contributor

@myieye myieye commented Oct 31, 2024

In this case the GQL error has almost certainly already been traced and we don't want to lose that info or else our global error handler will retrace it with a new trace.

Copy link
Contributor Author

myieye commented Oct 31, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @myieye and the rest of your teammates on Graphite Graphite

Copy link

github-actions bot commented Oct 31, 2024

UI unit Tests

12 tests  ±0   12 ✅ ±0   0s ⏱️ ±0s
 4 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit d9f87b2. ± Comparison against base commit 0a42f92.

♻️ This comment has been updated with latest results.

@myieye myieye force-pushed the gt/10-31-fix_trace_context_lost_when_squashing_and_rethrowing_gql_errors branch from 2846eff to 1aad582 Compare October 31, 2024 10:45
@myieye myieye marked this pull request as ready for review October 31, 2024 10:46
@myieye myieye force-pushed the gt/10-31-fix_trace_context_lost_when_squashing_and_rethrowing_gql_errors branch from 1aad582 to d9f87b2 Compare October 31, 2024 11:10
Copy link
Collaborator

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

when I use the sandbox GQL 500 I get this error in the console

Uncaught (in promise) Error: Object has already been traced (60abceb2db8c181adeba64eb41d328b0 vs 60abceb2db8c181adeba64eb41d328b0).
    TraceItError types.ts:27
    traceIt types.ts:33
    tryCopyTraceContext types.ts:51
    squashErrors gql-client.ts:305
    throwAnyUnexpectedErrors gql-client.ts:285
    queryStore gql-client.ts:203
    sync index.js:150
    unsubscribers index.js:164
    set index.js:56
    m queryStore.ts:185
    subscribe wonka.mjs:1068
    scan wonka.mjs:402
    switchMap wonka.mjs:591
    switchMap wonka.mjs:591
    applyInnerSource wonka.mjs:111
// ... etc

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.

2 participants