Skip to content

Commit 96f5d5f

Browse files
committed
chore: Ensure transition to falling back state based on synchronizer failure.
1 parent 3fa0a29 commit 96f5d5f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkgs/sdk/server/src/Internal/FDv2DataSources/FDv2DataSource.InitializationTracker.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ public void UpdateStatus(DataSourceState newState, DataSourceStatus.ErrorInfo? n
255255
case DataSourceCategory.Synchronizers when newState == DataSourceState.Off:
256256
{
257257
DetermineState(Action.SynchronizersExhausted);
258+
// Currently, FDv1 fallback happens in the synchronizers group. If something from that group
259+
// reports Off, with a reason indicating that it should fallback to v1, then we can
260+
// transition to that state.
261+
if (newError.HasValue && newError.Value.FDv1Fallback)
262+
{
263+
DetermineState(Action.FallingBack);
264+
}
258265
break;
259266
}
260267
case DataSourceCategory.FallbackSynchronizers when newState == DataSourceState.Off:
@@ -264,6 +271,8 @@ public void UpdateStatus(DataSourceState newState, DataSourceStatus.ErrorInfo? n
264271
}
265272
case DataSourceCategory.FallbackSynchronizers when newState == DataSourceState.Initializing:
266273
{
274+
// In the normal flow this will have be already handled via the `Off` state of the
275+
// synchronizers. This is purely redundant in the current implementation.
267276
DetermineState(Action.FallingBack);
268277
break;
269278
}

0 commit comments

Comments
 (0)