Skip to content

Commit 67974d0

Browse files
committed
qol fixes
1 parent ba24383 commit 67974d0

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

libs/common/src/events/asio_event_processor.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,25 +175,26 @@ std::vector<OutputEvent> AsioEventProcessor::Process(InputEvent input_event) {
175175
if (!event.eval_result.track_events()) {
176176
return;
177177
}
178-
std::optional<Reason> reason;
179178

180179
// TODO(cwaldren): should also add the reason if the
181180
// variation method was VariationDetail().
181+
std::optional<Reason> reason;
182182
if (event.eval_result.track_reason()) {
183183
reason = event.eval_result.detail().reason();
184184
}
185185

186186
client::FeatureEventBase base = {
187-
event.creation_date, std::move(event.key),
187+
event.creation_date,
188+
std::move(event.key),
188189
event.eval_result.version(),
189190
event.eval_result.detail().variation_index(),
190-
event.eval_result.detail().value(), reason,
191-
// TODO(cwaldren): change to actual default; figure
192-
// out where this should be plumbed through.
193-
Value::null()};
191+
event.eval_result.detail().value(),
192+
reason,
193+
std::move(event.default_)};
194194

195195
auto debug_until_date =
196196
event.eval_result.debug_events_until_date();
197+
197198
bool emit_debug_event =
198199
debug_until_date &&
199200
debug_until_date.value() >

libs/common/src/serialization/events/json_events.cpp

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,11 @@ void tag_invoke(boost::json::value_from_tag const& tag,
8989
namespace launchdarkly::events::detail {
9090
void tag_invoke(boost::json::value_from_tag const&,
9191
boost::json::value& json_value,
92-
Summarizer::VariationSummary const& state) {}
93-
94-
/*
95-
* version (number, optional): the value of version for the counter; if version
96-
has no value, this property should be omitted entirely rather than writing a
97-
null value.
98-
99-
variation (number, optional): the value of variation for the counter; if
100-
variation has no value, this property should be omitted entirely rather than
101-
writing a null value.
102-
103-
value (any JSON type): the value of value for the counter.
104-
105-
count (number, required): the value of count for the counter.
92+
Summarizer::VariationSummary const& state) {
93+
// todo(cwaldren): refactor the serialization out of the Summarizer:State
94+
// into here.
95+
}
10696

107-
unknown (boolean, optional): this should be true if version has no value;
108-
otherwise it should be omitted (do not write an explicit false).
109-
*/
11097
void tag_invoke(boost::json::value_from_tag const&,
11198
boost::json::value& json_value,
11299
Summarizer::State const& state) {

0 commit comments

Comments
 (0)