diff --git a/libs/internal/include/launchdarkly/data_model/item_descriptor.hpp b/libs/internal/include/launchdarkly/data_model/item_descriptor.hpp index 02c5c4254..1db675664 100644 --- a/libs/internal/include/launchdarkly/data_model/item_descriptor.hpp +++ b/libs/internal/include/launchdarkly/data_model/item_descriptor.hpp @@ -2,6 +2,7 @@ #include +#include #include #include diff --git a/libs/server-sdk/src/data_components/serialization_adapters/json_deserializer.hpp b/libs/server-sdk/src/data_components/serialization_adapters/json_deserializer.hpp index b610d2f5a..692ac8ffa 100644 --- a/libs/server-sdk/src/data_components/serialization_adapters/json_deserializer.hpp +++ b/libs/server-sdk/src/data_components/serialization_adapters/json_deserializer.hpp @@ -44,7 +44,8 @@ class JsonDeserializer final : public data_interfaces::IDataReader { template static tl::expected, data_interfaces::IDataReader::Error> - IntoStorageItem(integrations::SerializedItemDescriptor const& descriptor) { + DeserializeJsonDescriptor( + integrations::SerializedItemDescriptor const& descriptor) { if (descriptor.deleted) { return data_model::ItemDescriptor( data_model::Tombstone(descriptor.version)); @@ -90,7 +91,7 @@ class JsonDeserializer final : public data_interfaces::IDataReader { return std::nullopt; } - return IntoStorageItem(*serialized_item); + return DeserializeJsonDescriptor(*serialized_item); } template @@ -106,7 +107,7 @@ class JsonDeserializer final : public data_interfaces::IDataReader { Collection items; for (auto const& [key, descriptor] : *result) { - auto item = IntoStorageItem(descriptor); + auto item = DeserializeJsonDescriptor(descriptor); if (!item) { LD_LOG(logger_, LogLevel::kError) diff --git a/libs/server-sdk/tests/json_destination_test.cpp b/libs/server-sdk/tests/json_destination_test.cpp index 0e0fde53d..81779f6dc 100644 --- a/libs/server-sdk/tests/json_destination_test.cpp +++ b/libs/server-sdk/tests/json_destination_test.cpp @@ -164,7 +164,8 @@ TEST_F(JsonDestinationTest, UpsertDeletedSegmentCreatesTombstone) { 2, "{\"key\":\"segment\",\"version\":2,\"deleted\":true}"))) .WillOnce(Return(ISerializedDestination::UpsertResult::kSuccess)); - dest.Upsert("segment", data_model::SegmentDescriptor(data_model::Tombstone(2))); + dest.Upsert("segment", + data_model::SegmentDescriptor(data_model::Tombstone(2))); } TEST_F(JsonDestinationTest, UpsertFlagCreatesSerializedItem) {