Repository navigation
Add multiplyCustomUserDetail for the $mul user property modifier - #165
Merged
Merged
Conversation
arifBurakDemiray
force-pushed
the
board/parity-r132-countly-sdk-cpp
branch
from
November 2, 2026 09:35
765c720 to
2373783
Compare
arifBurakDemiray
marked this pull request as ready for review
November 2, 2026 09:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card C-137: Bring R132 Modifier mul to the C++ SDK
Why: the C++ SDK cannot multiply a custom user property on the server (
$mul), which Android, iOS, HarmonyOS and React Native ship (parity R132, referenceModuleUserProfile.multiply).Change:
Countly::multiplyCustomUserDetail(const std::string &key, double value)queuesuser_details={"custom":{"<key>":{"$mul":<value>}}}, after flushing recorded events likesetCustomUserDetails.start(), an empty key and a non-finite value are ignored with a log line.start()that still wait for the first session are queued first, so the server applies them before the multiplication.setCustomUserDetailsandaddEventshare the new filter helper (same behaviour).Decided:
setCustomUserDetails; rejected auserProfile()object withsave(), since this SDK has no profile cache.double, like iOS (NSNumber), HarmonyOS, React Native and Dart (Add multiply user property modifier countly-sdk-dart#13). The server takes JSON numbers, so2.0lands as2(plugins/users/api/ingestor.js).start()the call is ignored, likeaddEvent: Android'suserProfile()does not exist before init either.Checked:
tests/user_details.cpp: 6 cases, 67 assertions, and all 6 fail with the method body stubbed out. Whole suite on macOS arm64: 77 cases, 1300 assertions (SQLite off) and 94 cases, 1640 assertions (SQLite on)./iand/o/sdk): 7/irequests in the expected order (events, waiting details, four$mul,begin_sessionwithout details). The server's SBS blacklist andlklapplied, a key with&=+%arrived intact, 3 ignored calls logged.start(), then multiplied. The profile shows 10 × 2 = 20, 7 × 0.5 = 3.5 and 3 × 3 = 9 (the&=+%key), and all 6 requests were answeredSuccessin order.Not checked: the C++ help-center page has no "Modifying data" section yet (countly-backup-documentation, its own docs card).