Skip to content

Commit 83b997c

Browse files
test: fixed + associated code corrections
1 parent cbbf028 commit 83b997c

File tree

5 files changed

+82
-124
lines changed

5 files changed

+82
-124
lines changed

lib/core/odp/odp_manager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ export abstract class OdpManager implements IOdpManager {
103103
/**
104104
* ODP configuration settings for identifying the target API and segments
105105
* @protected
106-
* @readonly
107106
*/
108-
protected readonly odpIntegrationConfig?: OdpIntegrationConfig;
107+
protected odpIntegrationConfig?: OdpIntegrationConfig;
109108

110109
constructor({
111110
odpIntegrationConfig,

lib/plugins/odp_manager/index.node.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class NodeOdpManager extends OdpManager {
6464
clientEngine = clientEngine || NODE_CLIENT_ENGINE;
6565
clientVersion = clientVersion || CLIENT_VERSION;
6666

67-
let odpConfig : OdpConfig | undefined = undefined;
67+
let odpConfig: OdpConfig | undefined = undefined;
6868
if (odpIntegrationConfig?.integrated) {
6969
odpConfig = odpIntegrationConfig.odpConfig;
7070
}
@@ -87,10 +87,10 @@ export class NodeOdpManager extends OdpManager {
8787
} else {
8888
segmentManager = new OdpSegmentManager(
8989
odpOptions?.segmentsCache ||
90-
new ServerLRUCache<string, string[]>({
91-
maxSize: odpOptions?.segmentsCacheSize,
92-
timeout: odpOptions?.segmentsCacheTimeout,
93-
}),
90+
new ServerLRUCache<string, string[]>({
91+
maxSize: odpOptions?.segmentsCacheSize,
92+
timeout: odpOptions?.segmentsCacheTimeout,
93+
}),
9494
new OdpSegmentApiManager(customSegmentRequestHandler, logger),
9595
logger,
9696
odpConfig
@@ -133,8 +133,8 @@ export class NodeOdpManager extends OdpManager {
133133
logger,
134134
});
135135
}
136-
136+
137137
registerVuid(vuid: string | undefined): void {
138138
this.logger.log(LogLevel.ERROR, `Unable to registerVuid ${vuid || ''} in a node server context`);
139139
}
140-
}
140+
}

lib/plugins/vuid_manager/index.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export class VuidManager implements IVuidManager {
111111
async initialize(): Promise<void> {
112112
if (!this.vuidEnabled) {
113113
await this.cache.remove(this._keyForVuid);
114+
return;
114115
}
115116

116117
if (!this._vuid) {
@@ -168,13 +169,4 @@ export class VuidManager implements IVuidManager {
168169
* @returns *true* if the VisitorId is valid otherwise *false* for invalid
169170
*/
170171
static isVuid = (vuid: string | undefined): boolean => vuid?.startsWith(VuidManager.vuid_prefix) || false;
171-
172-
/**
173-
* Function used in unit testing to reset the VuidManager
174-
* **Important**: This should not to be used in production code
175-
* @private
176-
*/
177-
private _reset(): void {
178-
this._vuid = '';
179-
}
180172
}

0 commit comments

Comments
 (0)