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

Be more tolerant of errors triggered by store reset #1538

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

jerelmiller
Copy link
Member

@jerelmiller jerelmiller commented Oct 4, 2024

When the client is disconnected from devtools, commonly because of a page refresh, we clear the data in the devtools client to start with fresh data via client.clearStore(). This triggered some race conditions where a fetch could have started as a result of a poll on a particular tab and thus the error page would be displayed.

This PR makes the devtools more tolerant of errors related to store resets so that we can continue polling for data.


Fixes #1524

This also attempts to fix #1524 by using optional chaining when accessing clientErrors and protocolErrors when serializing errors.

@jerelmiller jerelmiller requested a review from alessbell October 4, 2024 15:19
@jerelmiller jerelmiller requested a review from a team as a code owner October 4, 2024 15:19
Copy link

pkg-pr-new bot commented Oct 4, 2024

npm i https://pkg.pr.new/apollographql/apollo-client-devtools/@apollo/client-devtools-vscode@1538

commit: ad72bb6

Copy link

relativeci bot commented Oct 4, 2024

#904 Bundle Size — 1.62MiB (+1%).

ad72bb6(current) vs 2d5e2db main#901(baseline)

Warning

Bundle contains 13 duplicate packages – View duplicate packages

Bundle metrics  Change 5 changes Regression 1 regression
                 Current
#904
     Baseline
#901
Regression  Initial JS 1.49MiB(+1.08%) 1.48MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 88.65% 0%
No change  Chunks 5 5
Change  Assets 145(+0.69%) 144
Change  Modules 1225(+0.49%) 1219
No change  Duplicate Modules 45 45
Change  Duplicate Code 3.12%(-0.32%) 3.13%
No change  Packages 183 183
No change  Duplicate Packages 10 10
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
#904
     Baseline
#901
Regression  JS 1.49MiB (+1.08%) 1.48MiB
Regression  Other 91.22KiB (+0.07%) 91.15KiB
No change  IMG 35.85KiB 35.85KiB
No change  HTML 857B 857B

Bundle analysis reportBranch jerel/fix-race-condition-resetProject dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
Contributor

@alessbell alessbell left a comment

Choose a reason for hiding this comment

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

🚀

@jerelmiller jerelmiller merged commit c8a8f2f into main Oct 4, 2024
11 of 12 checks passed
@jerelmiller jerelmiller deleted the jerel/fix-race-condition-reset branch October 4, 2024 17:47
@github-actions github-actions bot mentioned this pull request Oct 4, 2024
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.

ApolloError: Cannot read properties of undefined (reading 'map')
2 participants