Skip to content

Commit 2ab4feb

Browse files
Backtrace node readme (#93)
* Backtrace node readme * Fit 'n finish on node readme (#96) * Fit 'n finish on node readme * Modify enabled option to enable * Fix tests --------- Co-authored-by: Konrad Dysput <konrad.dysput@gmail.com> --------- Co-authored-by: Rick Foster <115846221+rick-bt@users.noreply.github.com>
1 parent 41fb8fc commit 2ab4feb

13 files changed

+413
-18
lines changed

examples/sdk/node/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const client = BacktraceClient.initialize({
2121
},
2222
},
2323
database: {
24-
enabled: true,
24+
enable: true,
2525
path: path.join(process.cwd(), 'database'),
2626
captureNativeCrashes: true,
2727
createDatabaseDirectory: true,

packages/node/README.md

Lines changed: 395 additions & 0 deletions
Large diffs are not rendered by default.

packages/node/src/BacktraceClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export class BacktraceClient extends BacktraceCoreClient {
195195
return;
196196
}
197197

198-
if (!this.options.database?.enabled) {
198+
if (!this.options.database?.enable) {
199199
return;
200200
}
201201

packages/node/src/database/BacktraceDatabaseFileStorageProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export class BacktraceDatabaseFileStorageProvider implements BacktraceDatabaseSt
2525
if (!options) {
2626
return undefined;
2727
}
28-
if (!options.enabled) {
28+
if (!options.enable) {
2929
return undefined;
3030
}
3131

32-
if (options.enabled && !options.path) {
32+
if (options.enable && !options.path) {
3333
throw new Error(
3434
'Missing mandatory path to the database. Please define the database.path option in the configuration.',
3535
);

packages/sdk-core/src/BacktraceCoreClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export abstract class BacktraceCoreClient {
117117
]);
118118
this.attachments = options.attachments ?? [];
119119

120-
if (databaseStorageProvider && options?.database?.enabled === true) {
120+
if (databaseStorageProvider && options?.database?.enable === true) {
121121
this._database = new BacktraceDatabase(
122122
this.options.database,
123123
databaseStorageProvider,

packages/sdk-core/src/model/configuration/BacktraceDatabaseConfiguration.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export interface EnabledBacktraceDatabaseConfiguration {
22
/**
33
* Determine if the Database is enabled
44
*/
5-
enabled: true;
5+
enable: true;
66
/**
77
* Path where the SDK can store data.
88
*/
@@ -46,11 +46,11 @@ export interface EnabledBacktraceDatabaseConfiguration {
4646
}
4747

4848
export interface DisabledBacktraceDatabaseConfiguration
49-
extends Omit<Partial<EnabledBacktraceDatabaseConfiguration>, 'enabled'> {
49+
extends Omit<Partial<EnabledBacktraceDatabaseConfiguration>, 'enable'> {
5050
/**
51-
* Determine if the Database is enabled
51+
* Determine if the Database is enable
5252
*/
53-
enabled?: false;
53+
enable?: false;
5454
}
5555

5656
export type BacktraceDatabaseConfiguration =

packages/sdk-core/src/modules/database/BacktraceDatabase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class BacktraceDatabase {
4343
return this._enabled;
4444
}
4545

46-
if (this._options?.enabled === false) {
46+
if (this._options?.enable === false) {
4747
return false;
4848
}
4949

packages/sdk-core/tests/database/databaseContextMemoryStorageTests.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { testStorageProvider } from '../mocks/testStorageProvider';
77

88
describe('Database context memory storage tests', () => {
99
const testDatabaseSettings = {
10-
enabled: true,
10+
enable: true,
1111
autoSend: false,
1212
// this option doesn't matter because we mock the database provider
1313
// interface. However, if bug happen we want to be sure to not create

packages/sdk-core/tests/database/databaseContextValidationTests.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { testStorageProvider } from '../mocks/testStorageProvider';
77
describe('Database context validation tests', () => {
88
describe('Record overflow tests', () => {
99
const testDatabaseSettings: BacktraceDatabaseConfiguration = {
10-
enabled: true,
10+
enable: true,
1111
autoSend: false,
1212
// this option doesn't matter because we mock the database provider
1313
// interface. However, if bug happen we want to be sure to not create

packages/sdk-core/tests/database/databaseRecordBatchTests.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('Database record batch tests', () => {
2323
const client = BacktraceTestClient.buildFakeClient(
2424
{
2525
database: {
26-
enabled: true,
26+
enable: true,
2727
autoSend: true,
2828
path: path.join(__dirname, 'database'),
2929
maximumRetries,
@@ -56,7 +56,7 @@ describe('Database record batch tests', () => {
5656
const client = BacktraceTestClient.buildFakeClient(
5757
{
5858
database: {
59-
enabled: true,
59+
enable: true,
6060
autoSend: true,
6161
path: path.join(__dirname, 'database'),
6262
maximumRetries,

0 commit comments

Comments
 (0)