-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
What is the bug?
The DDBClient implementation does not generate a new id
in the case where an empty string is provided as the id
. This is different from the LocalIndicesClient implementation where an Id is generated for both null or empty string.
DDB Client Existing Implementation
final String id = request.id() != null ? request.id() : UUID.randomUUID().toString();
Local Client Existing Implementation
if (!Strings.isNullOrEmpty(putDataObjectRequest.id())) {
indexRequest.id(putDataObjectRequest.id());
}
How can one reproduce the bug?
Create a PutDataObjectRequest
and provide id as an empty string, the operation will fail due to an error mentioning that the id is expected to be non-empty.
What is the expected behavior?
Similar to how the LocalIndicesClient implementation, the DDBClient implementation should also generate an id for both null and empty string.
Do you have any additional context?
The issue was noticed as part of onboarding opensearch alerting with the remote metadata sdk client