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(browser): Guard for this._flushOutcomes if old BaseClients are floating around #13085

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/browser/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export class BrowserClient extends BaseClient<BrowserClientOptions> {
if (opts.sendClientReports && WINDOW.document) {
WINDOW.document.addEventListener('visibilitychange', () => {
if (WINDOW.document.visibilityState === 'hidden') {
this._flushOutcomes();
// Theoretically and strictly speaking this check is unnecessary use people that have old BaseClients floating
lforst marked this conversation as resolved.
Show resolved Hide resolved
// around may not have the method. We guard for its existence to prevent these users from throwing here and eating up quota.
if (this._flushOutcomes) {
this._flushOutcomes();
}
}
});
}
Expand Down
Loading