Skip to content

Commit 18c2719

Browse files
fix: correct MultiProvider class name in docs and remove duplicate error logging (#1267)
Addresses feedback from #1265 (Gemini bot review comments). ## Changes 1. **Fixed documentation mismatch**: Updated all code examples to use `MultiProvider` instead of incorrect `WebMultiProvider` class name - `packages/web/README.md` (4 occurrences) - `packages/web/src/provider/multi-provider/README.md` (4 occurrences) 2. **Removed duplicate error logging**: Fixed redundant stack trace logging in `hook-executor.ts` where errors were being logged twice in both `errorHooks` and `finallyHooks` methods <!-- av pr metadata This information is embedded by the av CLI when creating PRs to track the status of stacks when using Aviator. Please do not delete or edit this section of the PR. ``` {"parent":"main","parentHead":"","trunk":"main"} ``` --> Signed-off-by: Jonathan Norris <[email protected]>
1 parent 8686dbf commit 18c2719

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

packages/web/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ The Multi-Provider is a powerful tool for performing migrations between flag pro
155155
- **Multiple Data Sources**: The Multi-Provider allows you to seamlessly combine many sources of flagging data, such as environment variables, local files, database values and SaaS hosted feature management systems.
156156

157157
```ts
158-
import { WebMultiProvider } from '@openfeature/web-sdk';
158+
import { MultiProvider } from '@openfeature/web-sdk';
159159

160-
const multiProvider = new WebMultiProvider([
160+
const multiProvider = new MultiProvider([
161161
{ provider: new ProviderA() },
162162
{ provider: new ProviderB() }
163163
]);
@@ -179,9 +179,9 @@ The Multi-Provider comes with three strategies out of the box:
179179
- **ComparisonStrategy**: Evaluates all providers sequentially. If every provider returns a successful result with the same value, then that result is returned. Otherwise, the result returned by the configured "fallback provider" will be used.
180180

181181
```ts
182-
import { WebMultiProvider, FirstSuccessfulStrategy } from '@openfeature/web-sdk';
182+
import { MultiProvider, FirstSuccessfulStrategy } from '@openfeature/web-sdk';
183183

184-
const multiProvider = new WebMultiProvider(
184+
const multiProvider = new MultiProvider(
185185
[
186186
{ provider: new ProviderA() },
187187
{ provider: new ProviderB() }

packages/web/src/provider/multi-provider/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ feature flagging interface. For example:
99

1010
- *Migration*: When migrating between two providers, you can run both in parallel under a unified flagging interface. As flags are added to the
1111
new provider, the Multi-Provider will automatically find and return them, falling back to the old provider if the new provider does not have
12-
- *Multiple Data Sources*: The Multi-Provider allows you to seamlessly combine many sources of flagging data, such as environment variables,
12+
- *Multiple Data Sources*: The Multi-Provider allows you to seamlessly combine many sources of flagging data, such as environment variables,
1313
local files, database values and SaaS hosted feature management systems.
1414

1515
## Usage
1616

1717
The Multi-Provider is initialized with an array of providers it should evaluate:
1818

1919
```typescript
20-
import { WebMultiProvider } from '@openfeature/web-sdk'
20+
import { MultiProvider } from '@openfeature/web-sdk'
2121
import { OpenFeature } from '@openfeature/web-sdk'
2222

23-
const multiProvider = new WebMultiProvider([
23+
const multiProvider = new MultiProvider([
2424
{ provider: new ProviderA() },
2525
{ provider: new ProviderB() }
2626
])
@@ -41,9 +41,9 @@ will fail with a FLAG_NOT_FOUND error code.
4141
To change this behaviour, a different "strategy" can be provided:
4242

4343
```typescript
44-
import { WebMultiProvider, FirstSuccessfulStrategy } from '@openfeature/web-sdk'
44+
import { MultiProvider, FirstSuccessfulStrategy } from '@openfeature/web-sdk'
4545

46-
const multiProvider = new WebMultiProvider(
46+
const multiProvider = new MultiProvider(
4747
[
4848
{ provider: new ProviderA() },
4949
{ provider: new ProviderB() }
@@ -67,10 +67,10 @@ in configuration without affecting flag behaviour.
6767
This strategy accepts several arguments during initialization:
6868

6969
```typescript
70-
import { WebMultiProvider, ComparisonStrategy } from '@openfeature/web-sdk'
70+
import { MultiProvider, ComparisonStrategy } from '@openfeature/web-sdk'
7171

7272
const providerA = new ProviderA()
73-
const multiProvider = new WebMultiProvider(
73+
const multiProvider = new MultiProvider(
7474
[
7575
{ provider: providerA },
7676
{ provider: new ProviderB() }
@@ -137,10 +137,10 @@ The Multi-Provider supports tracking events across multiple providers, allowing
137137
### Basic Tracking Usage
138138

139139
```typescript
140-
import { WebMultiProvider } from '@openfeature/web-sdk'
140+
import { MultiProvider } from '@openfeature/web-sdk'
141141
import { OpenFeature } from '@openfeature/web-sdk'
142142

143-
const multiProvider = new WebMultiProvider([
143+
const multiProvider = new MultiProvider([
144144
{ provider: new ProviderA() },
145145
{ provider: new ProviderB() }
146146
])

packages/web/src/provider/multi-provider/hook-executor.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export class HookExecutor {
3535
if (err instanceof Error) {
3636
this.logger.error(err.stack);
3737
}
38-
this.logger.error((err as Error)?.stack);
3938
}
4039
}
4140
}
@@ -55,7 +54,6 @@ export class HookExecutor {
5554
if (err instanceof Error) {
5655
this.logger.error(err.stack);
5756
}
58-
this.logger.error((err as Error)?.stack);
5957
}
6058
}
6159
}

0 commit comments

Comments
 (0)