Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Oct 14, 2024
1 parent 8622baa commit 60cadd7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions posthog-node/src/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class FeatureFlagsPoller {
): Promise<string | boolean | undefined> {
await this.loadFeatureFlags()

let response: string | boolean | PromiseLike<string | boolean | undefined> | undefined = undefined
let response: string | boolean | undefined = undefined
let featureFlag = undefined

if (!this.loadedSuccessfullyOnce) {
Expand Down Expand Up @@ -590,7 +590,6 @@ function matchCohort(
}

function matchPropertyGroup(
this: any,
propertyGroup: PropertyGroup,
propertyValues: Record<string, any>,
cohortProperties: FeatureFlagsPoller['cohorts'],
Expand Down Expand Up @@ -627,7 +626,9 @@ function matchPropertyGroup(
}
} catch (err) {
if (err instanceof InconclusiveMatchError) {
this.logMsgIfDebug(() => console.debug(`Failed to compute property ${prop} locally: ${err}`))
if (debugMode) {
console.debug(`Failed to compute property ${prop} locally: ${err}`)
}
errorMatchingLocally = true
} else {
throw err
Expand Down Expand Up @@ -671,7 +672,9 @@ function matchPropertyGroup(
}
} catch (err) {
if (err instanceof InconclusiveMatchError) {
this.logMsgIfDebug(() => console.debug(`Failed to compute property ${prop} locally: ${err}`))
if (debugMode) {
console.debug(`Failed to compute property ${prop} locally: ${err}`)
}
errorMatchingLocally = true
} else {
throw err
Expand Down

0 comments on commit 60cadd7

Please sign in to comment.