Skip to content

Commit bdc3e68

Browse files
committed
fixup: revert enum change
Signed-off-by: Todd Baert <[email protected]>
1 parent 701069a commit bdc3e68

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/InProcessResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ public void init() throws Exception {
8888

8989
log.debug("post onConnectionEvent.accept ProviderEvent.PROVIDER_CONFIGURATION_CHANGED");
9090
break;
91-
case TRANSIENT_ERROR:
91+
case STALE:
9292
onConnectionEvent.accept(ProviderEvent.PROVIDER_ERROR, null, null);
9393
break;
94-
case FATAL_ERROR:
94+
case ERROR:
9595
onConnectionEvent.accept(
9696
ProviderEvent.PROVIDER_ERROR,
9797
ProviderEventDetails.builder()

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/storage/FlagStore.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,19 @@ private void streamerListener(final QueueSource connector) throws InterruptedExc
132132
} catch (Throwable e) {
133133
// catch all exceptions and avoid stream listener interruptions
134134
log.warn("Invalid flag sync payload from connector", e);
135-
if (!stateBlockingQueue.offer(new StorageStateChange(StorageState.TRANSIENT_ERROR))) {
135+
if (!stateBlockingQueue.offer(new StorageStateChange(StorageState.STALE))) {
136136
log.warn("Failed to convey TRANSIENT_ERROR status, queue is full");
137137
}
138138
}
139139
break;
140140
case ERROR:
141-
if (!stateBlockingQueue.offer(new StorageStateChange(StorageState.TRANSIENT_ERROR))) {
141+
if (!stateBlockingQueue.offer(new StorageStateChange(StorageState.STALE))) {
142142
log.warn("Failed to convey TRANSIENT_ERROR status, queue is full");
143143
}
144144
break;
145145
case SHUTDOWN:
146146
shutdown();
147-
if (!stateBlockingQueue.offer(new StorageStateChange(StorageState.FATAL_ERROR))) {
147+
if (!stateBlockingQueue.offer(new StorageStateChange(StorageState.ERROR))) {
148148
log.warn("Failed to convey FATAL_ERROR status, queue is full");
149149
}
150150
break;

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/storage/StorageState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public enum StorageState {
55
/** Storage is upto date and working as expected. */
66
OK,
77
/** Storage has gone stale (most recent sync failed). May get to OK status with next sync. */
8-
TRANSIENT_ERROR,
8+
STALE,
99
/** Storage is in an unrecoverable error stage. */
10-
FATAL_ERROR,
10+
ERROR,
1111
}

providers/flagd/src/test/java/dev/openfeature/contrib/providers/flagd/resolver/process/InProcessResolverTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void eventHandling() throws Throwable {
116116
boolean isDisconnected =
117117
event == ProviderEvent.PROVIDER_ERROR || event == ProviderEvent.PROVIDER_STALE;
118118
receiver.offer(new StorageStateChange(
119-
isDisconnected ? StorageState.FATAL_ERROR : StorageState.OK,
119+
isDisconnected ? StorageState.ERROR : StorageState.OK,
120120
details != null ? details.getFlagsChanged() : Collections.emptyList(),
121121
metadata));
122122
});
@@ -135,7 +135,7 @@ void eventHandling() throws Throwable {
135135
TimeUnit.MILLISECONDS)) {
136136
Assertions.fail("failed to send the event");
137137
}
138-
if (!sender.offer(new StorageStateChange(StorageState.FATAL_ERROR), 100, TimeUnit.MILLISECONDS)) {
138+
if (!sender.offer(new StorageStateChange(StorageState.ERROR), 100, TimeUnit.MILLISECONDS)) {
139139
Assertions.fail("failed to send the event");
140140
}
141141

providers/flagd/src/test/java/dev/openfeature/contrib/providers/flagd/resolver/process/storage/FlagStoreTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void connectorHandling() throws Exception {
4646
});
4747

4848
assertTimeoutPreemptively(Duration.ofMillis(maxDelay), () -> {
49-
assertEquals(StorageState.TRANSIENT_ERROR, states.take().getStorageState());
49+
assertEquals(StorageState.STALE, states.take().getStorageState());
5050
});
5151

5252
// OK again for next payload
@@ -64,14 +64,14 @@ void connectorHandling() throws Exception {
6464
});
6565

6666
assertTimeoutPreemptively(Duration.ofMillis(maxDelay), () -> {
67-
assertEquals(StorageState.TRANSIENT_ERROR, states.take().getStorageState());
67+
assertEquals(StorageState.STALE, states.take().getStorageState());
6868
});
6969

7070
// Shutdown handling
7171
store.shutdown();
7272

7373
assertTimeoutPreemptively(Duration.ofMillis(maxDelay), () -> {
74-
assertEquals(StorageState.TRANSIENT_ERROR, states.take().getStorageState());
74+
assertEquals(StorageState.STALE, states.take().getStorageState());
7575
});
7676
}
7777

0 commit comments

Comments
 (0)