From 160933e8eb4b86126bc1d8a4d955a3586dc75088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Tue, 19 Feb 2019 15:25:45 +0100 Subject: [PATCH] feat: Disable client once flushed (#1904) --- CHANGELOG.md | 1 + packages/core/src/baseclient.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff6cfd4ad4d3..86b11ecf9e1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ since we removed some methods from the public API and removed some classes from - **breaking** [core] ref: Use `SyncPromise` internally, this reduces memory pressure by a lot. - **breaking** [browser] ref: Removed `BrowserBackend` from default export. - **breaking** [node] ref: Removed `BrowserBackend` from default export. +- **breaking** [core] feat: Disable client once flushed using `close` method - ref: Move internal `ExtendedError` to a types package - **breaking** [core] ref: Pass `Event` to `sendEvent` instead of already stringified data - [utils] feat: Introduce `isSyntheticEvent` util diff --git a/packages/core/src/baseclient.ts b/packages/core/src/baseclient.ts index e7d0deb27eee..87da0ef8751d 100644 --- a/packages/core/src/baseclient.ts +++ b/packages/core/src/baseclient.ts @@ -333,7 +333,9 @@ export abstract class BaseClient implement * @inheritDoc */ public async close(timeout?: number): Promise { - return this.flush(timeout); + return this.flush(timeout).finally(() => { + this.getOptions().enabled = false; + }); } /**