Skip to content

Commit

Permalink
chore: Fix bandit events queue. (#200)
Browse files Browse the repository at this point in the history
* chore: Fix bandit events queue.

* lint
  • Loading branch information
leoromanovsky authored Jan 15, 2025
1 parent 3f84c6b commit 8a07c10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eppo/js-client-sdk-common",
"version": "4.9.0-alpha.1",
"version": "4.8.2",
"description": "Common library for Eppo JavaScript SDKs (web, react native, and node)",
"main": "dist/index.js",
"files": [
Expand Down
6 changes: 3 additions & 3 deletions src/client/eppo-precomputed-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
} from '../constants';
import { decodePrecomputedFlag } from '../decoding';
import { FlagEvaluationWithoutDetails } from '../evaluator';
import { BoundedEventQueue } from '../events/bounded-event-queue';
import FetchHttpClient from '../http-client';
import {
IPrecomputedBandit,
Expand Down Expand Up @@ -68,8 +67,7 @@ interface EppoPrecomputedClientOptions {

export default class EppoPrecomputedClient {
private readonly queuedAssignmentEvents: IAssignmentEvent[] = [];
private readonly banditEventsQueue: BoundedEventQueue<IBanditEvent> =
new BoundedEventQueue<IBanditEvent>('bandit');
private readonly banditEventsQueue: IBanditEvent[] = [];
private assignmentLogger?: IAssignmentLogger;
private banditLogger?: IBanditLogger;
private banditAssignmentCache?: AssignmentCache;
Expand Down Expand Up @@ -381,6 +379,8 @@ export default class EppoPrecomputedClient {

public setBanditLogger(logger: IBanditLogger) {
this.banditLogger = logger;
// log any bandit events that may have been queued while initializing
this.flushQueuedEvents(this.banditEventsQueue, this.banditLogger?.logBanditAction);
}

/**
Expand Down

0 comments on commit 8a07c10

Please sign in to comment.