Skip to content

Commit

Permalink
Revert "fix: check that config store is initialized before skipping f…
Browse files Browse the repository at this point in the history
…etch", bump to v4.8.1 (#199)

* Revert "fix: check that config store is initialized when considering to skip …"
* bump version to 4.8.1

This reverts commit 940d210.
  • Loading branch information
typotter authored Jan 14, 2025
1 parent 247ec29 commit 81c2ea8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 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.8.0",
"version": "4.8.1",
"description": "Common library for Eppo JavaScript SDKs (web, react native, and node)",
"main": "dist/index.js",
"files": [
Expand Down
7 changes: 0 additions & 7 deletions src/client/eppo-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,6 @@ describe('EppoClient E2E test', () => {
it('Continues to poll when cache has not expired', async () => {
class MockStore<T> extends MemoryOnlyConfigurationStore<T> {
public static expired = false;
public isInitialized(): boolean {
return true;
}

async isExpired(): Promise<boolean> {
return MockStore.expired;
Expand Down Expand Up @@ -802,10 +799,6 @@ describe('EppoClient E2E test', () => {
});
it('Does not fetch configurations if the configuration store is unexpired', async () => {
class MockStore<T> extends MemoryOnlyConfigurationStore<T> {
public isInitialized(): boolean {
return true;
}

async isExpired(): Promise<boolean> {
return false;
}
Expand Down
5 changes: 1 addition & 4 deletions src/client/eppo-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ export default class EppoClient {
);

const pollingCallback = async () => {
if (
!this.flagConfigurationStore.isInitialized() ||
(await this.flagConfigurationStore.isExpired())
) {
if (await this.flagConfigurationStore.isExpired()) {
return configurationRequestor.fetchAndStoreConfigurations();
}
};
Expand Down

0 comments on commit 81c2ea8

Please sign in to comment.