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

Handle client termination and recreation #1303

Merged
merged 8 commits into from
Mar 29, 2024

Conversation

jerelmiller
Copy link
Member

Fixes #1240

Handles when client.stop is called and properly disconnects the client instance from devtools and performs some cleanup in the content script. This also makes it possible to track newly created clients after a previous client was terminated.

@jerelmiller jerelmiller requested a review from a team as a code owner March 28, 2024 05:30
InMemoryCache,
makeReference,
useQuery,
} from "@apollo/client";
import ColorSchemeGenerator from "./ColorSchemeGenerator";
import Favorites from "./Favorites";
import ColorLookup from "./ColorLookup";
import { GET_SAVED_COLORS } from "./queries";
import "./App.css";

function App() {
Copy link
Member Author

Choose a reason for hiding this comment

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

To make this testable, I had to move some code around so that I could recreate the client and ensure it was set in context correctly.

Copy link

relativeci bot commented Mar 28, 2024

Job #134: Bundle Size — 849.63KiB (+0.03%).

249e933(current) vs d96a9fd main#129(baseline)

Warning

Bundle contains 5 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
Job #134
     Baseline
Job #129
Regression  Initial JS 812.23KiB(+0.03%) 811.99KiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 3.41% 0%
No change  Chunks 5 5
No change  Assets 12 12
No change  Modules 638 638
No change  Duplicate Modules 35 35
No change  Duplicate Code 5.22% 5.22%
No change  Packages 58 58
No change  Duplicate Packages 4 4
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #134
     Baseline
Job #129
Regression  JS 812.23KiB (+0.03%) 811.99KiB
Not changed  IMG 35.85KiB 35.85KiB
Not changed  HTML 810B 810B
Not changed  Other 778B 778B

View job #134 reportView jerel/fix-client-termination branch activityView project dashboard

Copy link
Member

@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.

A really nice quality of life improvement! 🚀

src/extension/tab/hook.ts Outdated Show resolved Hide resolved
@jerelmiller jerelmiller merged commit df0d242 into main Mar 29, 2024
9 checks passed
@jerelmiller jerelmiller deleted the jerel/fix-client-termination branch March 29, 2024 17:03
@github-actions github-actions bot mentioned this pull request Mar 29, 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.

Impossible to track newly-created ApolloClients
2 participants