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

docs(hub): 📝 multi-hub integrations setup #1689

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -85,6 +85,8 @@ const client1 = new Sentry.BrowserClient({
return null; // Returning null does not send the event
}
});
client1.setupIntegrations();

const hub1 = new Sentry.Hub(client1);
Comment on lines +88 to 90
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
client1.setupIntegrations();
const hub1 = new Sentry.Hub(client1);
const hub1 = new Sentry.Hub(client1);
hub1.bindClient(client1);


const client2 = new Sentry.BrowserClient({
Expand All @@ -95,6 +97,8 @@ const client2 = new Sentry.BrowserClient({
return null; // Returning null does not send the event
}
});
client2.setupIntegrations();

const hub2 = new Sentry.Hub(client2);
Comment on lines +100 to 102
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
client2.setupIntegrations();
const hub2 = new Sentry.Hub(client2);
const hub2 = new Sentry.Hub();
hub2.bindClient(client2);

Copy link
Member

Choose a reason for hiding this comment

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

This is actually a bug, we should call bindClient in the Hub constructor. cc @kamilogorek

Copy link
Member

Choose a reason for hiding this comment

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


hub1.run(currentHub => { // The hub.run method makes sure that Sentry.getCurrentHub() returns this hub during the callback
Expand Down