Skip to content

Commit e256730

Browse files
committed
un async bootstrap :)
1 parent b7882b5 commit e256730

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/client/eppo-client-with-bandits.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ describe('EppoClient Bandits E2E test', () => {
151151
client.setIsGracefulFailureMode(false);
152152

153153
// Bootstrap using the bandit flag config.
154-
await client.bootstrap(banditFlagsConfig);
154+
client.bootstrap(banditFlagsConfig);
155155
});
156156

157157
it.each(Object.keys(testCases))('Shared bandit test case - %s', async (fileName: string) => {

src/client/eppo-client.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,14 @@ describe('EppoClient E2E test', () => {
365365

366366
describe('Not obfuscated', () => {
367367
let client: EppoClient;
368-
beforeAll(async () => {
368+
beforeAll(() => {
369369
client = new EppoClient({
370370
flagConfigurationStore: new MemoryOnlyConfigurationStore(),
371371
});
372372
client.setIsGracefulFailureMode(false);
373373

374374
// Bootstrap using the flags config.
375-
await client.bootstrap(bootstrapFlagsConfig);
375+
client.bootstrap(bootstrapFlagsConfig);
376376
});
377377

378378
it('contains some key flags', () => {
@@ -389,14 +389,14 @@ describe('EppoClient E2E test', () => {
389389

390390
describe('Obfuscated', () => {
391391
let client: EppoClient;
392-
beforeAll(async () => {
392+
beforeAll(() => {
393393
client = new EppoClient({
394394
flagConfigurationStore: new MemoryOnlyConfigurationStore(),
395395
});
396396
client.setIsGracefulFailureMode(false);
397397

398398
// Bootstrap using the obfuscated flags config.
399-
await client.bootstrap(bootstrapFlagsObfuscatedConfig);
399+
client.bootstrap(bootstrapFlagsObfuscatedConfig);
400400
});
401401

402402
it('contains some key flags', () => {

src/client/eppo-client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default class EppoClient {
326326
* accommodate writing to a persistent store. For fastest initialization, (at the cost of persisting configuration),
327327
* use `bootstrap` in conjunction with `MemoryOnlyConfigurationStore` instances which won't do an async write.
328328
*/
329-
async bootstrap(configuration: IConfigurationWire): Promise<void> {
329+
bootstrap(configuration: IConfigurationWire): void {
330330
if (!configuration.config) {
331331
throw new Error('Flag configuration not provided');
332332
}
@@ -340,7 +340,8 @@ export default class EppoClient {
340340
// This method runs async because the configuration stores potentially have an async write at the end of updating
341341
// the configuration. Most instances of offlineInit will use `MemoryOnlyConfigurationStore` instances which actually
342342
// accomplish the config write synchronously.
343-
await this.configurationManager.hydrateConfigurationStoresFromUfc(
343+
// `void` keyword here suppresses warnings about leaving the promise hanging.
344+
void this.configurationManager.hydrateConfigurationStoresFromUfc(
344345
flagConfigResponse,
345346
banditParamResponse,
346347
);

0 commit comments

Comments
 (0)