-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Problem
When a circular segment dependency is detected, the Rust resolver returns an InternalError. Java returns NO_SEGMENT_MATCH, consistent with how other segment evaluation failures are handled.
Rust behavior
confidence-resolver/src/lib.rs ~L1290-1292:
if visited.contains(&segment.name) {
fail!("circular segment dependency found");
}The fail!() macro returns a ResolveError::Internal, which surfaces as an error to the caller.
Java behavior
AccountResolver.java ~L608-636:
if (visitedSegments.contains(segmentName)) {
throw new InternalServerException(
"Segment %s has a circular dependency".formatted(segmentName));
}Java also throws, but the exception is caught in the surrounding segmentMatches() method:
} catch (RuntimeException error) {
logger.error("Error during targeting for flag {}", flag, error);
return false; // returns false → NO_SEGMENT_MATCH
}The circular dependency is logged as an error but treated as a segment evaluation failure, returning false. This causes the rule to be skipped and the flag resolves with NO_SEGMENT_MATCH.
Affected spec tests
circular_segment_dependency
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels