Skip to content

Commit 9180c03

Browse files
authored
Merge pull request #592 from splitio/prepare-release-10.4.0
Added prevention for telemetry post if counters are empty
2 parents 2512740 + 3b8283d commit 9180c03

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
10.4.0 (Aug 1, 2025)
1+
10.4.0 (Aug 4, 2025)
22
- Added a new optional argument to the client `getTreatment` methods to allow passing additional evaluation options, such as a map of properties to append to the generated impressions sent to Split backend. Read more in our docs.
33

44
10.3.0 (Jun 17, 2025)

splitio/engine/impressions/adapters.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ async def record_unique_keys(self, uniques):
8989
:param uniques: unique keys disctionary
9090
:type uniques: Dictionary {'feature_flag1': set(), 'feature_flag2': set(), .. }
9191
"""
92+
if len(uniques) == 0:
93+
return
94+
9295
await self._telemtry_http_client.record_unique_keys({'keys': self._uniques_formatter(uniques)})
9396

9497

@@ -184,6 +187,9 @@ async def record_unique_keys(self, uniques):
184187
:param uniques: unique keys disctionary
185188
:type uniques: Dictionary {'feature_flag1': set(), 'feature_flag2': set(), .. }
186189
"""
190+
if len(uniques) == 0:
191+
return True
192+
187193
bulk_mtks = _uniques_formatter(uniques)
188194
try:
189195
inserted = await self._redis_client.rpush(_MTK_QUEUE_KEY, *bulk_mtks)
@@ -202,6 +208,9 @@ async def flush_counters(self, to_send):
202208
:param to_send: unique keys disctionary
203209
:type to_send: Dictionary {'feature_flag1': set(), 'feature_flag2': set(), .. }
204210
"""
211+
if len(to_send) == 0:
212+
return True
213+
205214
try:
206215
resulted = 0
207216
counted = 0
@@ -277,6 +286,7 @@ def flush_counters(self, to_send):
277286
"""
278287
if len(to_send) == 0:
279288
return
289+
280290
try:
281291
resulted = 0
282292
for pf_count in to_send:
@@ -325,6 +335,9 @@ async def record_unique_keys(self, uniques):
325335
:param uniques: unique keys disctionary
326336
:type uniques: Dictionary {'feature_flag1': set(), 'feature_flag2': set(), .. }
327337
"""
338+
if len(uniques) == 0:
339+
return True
340+
328341
bulk_mtks = _uniques_formatter(uniques)
329342
try:
330343
inserted = await self._adapter_client.push_items(self._prefix + _MTK_QUEUE_KEY, *bulk_mtks)
@@ -343,6 +356,9 @@ async def flush_counters(self, to_send):
343356
:param to_send: unique keys disctionary
344357
:type to_send: Dictionary {'feature_flag1': set(), 'feature_flag2': set(), .. }
345358
"""
359+
if len(to_send) == 0:
360+
return True
361+
346362
try:
347363
resulted = 0
348364
for pf_count in to_send:

0 commit comments

Comments
 (0)