fix(iot): return ConflictException for shadow version mismatch (#5814)

* fix(iot): return ConflictException for shadow version mismatch

* fix(iot): match AWS shadow version conflict message

* test(iot): expect modeled shadow conflict in Python SDK
This commit is contained in:
XuJian authored and GitHub committed 2026-10-16 17:52:27 -04:00
1 parent e245dbbdd5
commit eb84539a67
3 files changed
+40 -3

No files matched your search

@@ -865,7 +865,7 @@ public class IotService {
ObjectNode document = existing == null ? objectMapper.createObjectNode() : (ObjectNode) readJson(existing.getDocument()).deepCopy();
long currentVersion = existing == null ? 0 : existing.getVersion();
if (request.hasNonNull("version") && request.path("version").asLong() != currentVersion) {
throw new AwsException("VersionConflictException", "Shadow version does not match requested version", 409);
throw new AwsException("ConflictException", "Version conflict", 409);
}
ObjectNode state = document.withObject("/state");
JsonNode requestState = request.path("state");