GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fixed a bug where calling startup multiple times with a callback woul… · rchcomm/Exceptionless.JavaScript@7c465d7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • browser/src
      • BrowserExceptionlessClient.ts
    • core/src
      • ExceptionlessClient.ts
    • node/src
      • NodeExceptionlessClient.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/browser/src/BrowserExceptionlessClient.ts‎

Copy file name to clipboardExpand all lines: packages/browser/src/BrowserExceptionlessClient.ts
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ import { BrowserRequestInfoPlugin } from "./plugins/BrowserRequestInfoPlugin.js"
88
import { BrowserWrapFunctions } from "./plugins/BrowserWrapFunctions.js";
99

1010
export class BrowserExceptionlessClient extends ExceptionlessClient {
11-
public async startup(
12-
configurationOrApiKey?: (config: Configuration) => void | string,
13-
): Promise<void> {
11+
public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise<void> {
1412
const config = this.config;
15-
if (configurationOrApiKey) {
13+
if (configurationOrApiKey && !this._initialized) {
1614
config.useLocalStorage();
1715

1816
config.addPlugin(new BrowserGlobalHandlerPlugin());
@@ -24,7 +22,7 @@ export class BrowserExceptionlessClient extends ExceptionlessClient {
2422
}
2523

2624
await super.startup(configurationOrApiKey);
27-
if (configurationOrApiKey) {
25+
if (configurationOrApiKey && !this._initialized) {
2826
config.removePlugin(new SimpleErrorPlugin());
2927
}
3028
}
Collapse file

‎packages/core/src/ExceptionlessClient.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/ExceptionlessClient.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import { PluginContext } from "./plugins/PluginContext.js";
1111
export class ExceptionlessClient {
1212
private _intervalId = 0;
1313
private _timeoutId = 0;
14+
protected _initialized = false;
1415

1516
public constructor(public config: Configuration = new Configuration()) { }
1617

1718
/** Resume background submission, resume any timers. */
1819
public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise<void> {
19-
if (configurationOrApiKey) {
20+
if (configurationOrApiKey && !this._initialized) {
21+
this._initialized = true;
2022
EventPluginManager.addDefaultPlugins(this.config);
2123

2224
if (typeof configurationOrApiKey === "string") {
@@ -33,6 +35,7 @@ export class ExceptionlessClient {
3335

3436
this.updateSettingsTimer(!!configurationOrApiKey);
3537
await EventPluginManager.startup(new PluginContext(this));
38+
3639
const { queue } = this.config.services;
3740
await queue.startup();
3841
if (this.config.usePersistedQueueStorage) {
Collapse file

‎packages/node/src/NodeExceptionlessClient.ts‎

Copy file name to clipboardExpand all lines: packages/node/src/NodeExceptionlessClient.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class NodeExceptionlessClient extends ExceptionlessClient {
2020
public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise<void> {
2121
const config = this.config;
2222

23-
if (configurationOrApiKey) {
23+
if (configurationOrApiKey && !this._initialized) {
2424
if (!globalThis?.localStorage) {
2525
const storage = new LocalStorage(undefined, new LocalStoragePolyfill(process.cwd() + '/.exceptionless'));
2626
config.useLocalStorage = () => storage;
@@ -43,7 +43,7 @@ export class NodeExceptionlessClient extends ExceptionlessClient {
4343

4444
await super.startup(configurationOrApiKey);
4545

46-
if (configurationOrApiKey) {
46+
if (configurationOrApiKey && !this._initialized) {
4747
config.removePlugin(new SimpleErrorPlugin());
4848
}
4949
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.