Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
219adba
Updating Logs
Aug 3, 2024
1935946
feat: auto events on user props
arifBurakDemiray Dec 4, 2025
80b27e9
feat: chnagelog for it
arifBurakDemiray Dec 4, 2025
c474f1f
Update CHANGELOG.md
arifBurakDemiray Dec 9, 2025
52c40c8
Update CHANGELOG.md
turtledreams Dec 9, 2025
4e637d5
feat: 23.2.4
arifBurakDemiray Dec 10, 2025
b16151b
feat: add test case for it
arifBurakDemiray Dec 11, 2025
f3bce6c
Merge pull request #145 from Countly/auto_events_on_user_props
turtledreams Dec 12, 2025
54c76d6
feat: header file
arifBurakDemiray Jan 6, 2026
7459679
feat: initial impl
arifBurakDemiray Jan 6, 2026
7289c7e
feat: adding init module
arifBurakDemiray Jan 6, 2026
65b3704
feat: adding to module file
arifBurakDemiray Jan 6, 2026
c89333b
feat: changelog
arifBurakDemiray Jan 6, 2026
7c74605
feat: intoruce config provider contract
arifBurakDemiray Jan 7, 2026
1f796dc
feat: impl config contract to request module
arifBurakDemiray Jan 7, 2026
a01e9eb
feat: imp contract to modules
arifBurakDemiray Jan 7, 2026
71a6bd3
feat: impl contract
arifBurakDemiray Jan 7, 2026
61ac50d
fix: move stting provider to after module inits
arifBurakDemiray Jan 7, 2026
dda3be2
feat: update gitignore
arifBurakDemiray Jan 7, 2026
5766a52
feat: sbs RQ limit
arifBurakDemiray Jan 7, 2026
ecb436b
feat: use atomic for accessing sbs values
arifBurakDemiray Jan 7, 2026
533c25f
feat: use EQ size sbs
arifBurakDemiray Jan 7, 2026
cc14a3b
feat: remove unsued sbs
arifBurakDemiray Jan 7, 2026
8fc0e6e
feat: integrate custom event tracking
arifBurakDemiray Jan 7, 2026
e00e8fd
feat: session update interval
arifBurakDemiray Jan 8, 2026
2460bfc
feat: config provider to views module
arifBurakDemiray Jan 8, 2026
d8749b9
feat: config to crash module
arifBurakDemiray Jan 8, 2026
1d20263
feat: expose crash reporting flag to provider
arifBurakDemiray Jan 8, 2026
6f752c5
feat: expose view reporting flag to provider
arifBurakDemiray Jan 8, 2026
50bf4ea
feat: integrate sbs to view tracking
arifBurakDemiray Jan 8, 2026
e182799
feat: integrate sbs to crash reporting
arifBurakDemiray Jan 8, 2026
c21bcaa
feat: integrate session tracking
arifBurakDemiray Jan 8, 2026
eaeeb7b
feat: record location expose to cly delegate
arifBurakDemiray Jan 8, 2026
210e9ac
mixed: location tracking & cly delegate to config module
arifBurakDemiray Jan 8, 2026
98731b4
refactor: more precise param setting
arifBurakDemiray Jan 8, 2026
5195333
feat: config module update timer
arifBurakDemiray Jan 8, 2026
2556c7b
refactor: reorder functions internal
arifBurakDemiray Jan 8, 2026
ea27c94
feat: introduce storage for sbs
arifBurakDemiray Jan 8, 2026
efc88dc
feat: impls of them
arifBurakDemiray Jan 8, 2026
001f430
feat: fetching from storage
arifBurakDemiray Jan 8, 2026
5790876
feat: SBS configs in configuration
arifBurakDemiray Jan 9, 2026
c83af8b
feat: using sbs updates config
arifBurakDemiray Jan 9, 2026
923d9e1
feat: impl provided sbs
arifBurakDemiray Jan 12, 2026
c3ac4d2
feat: on sbs changed for sbs update interval
arifBurakDemiray Jan 12, 2026
70cecc0
feat: add missing session params for update
arifBurakDemiray Jan 12, 2026
368b142
feat: use networking
arifBurakDemiray Jan 12, 2026
e42921c
fix: crash tests
arifBurakDemiray Jan 14, 2026
07848d5
fix: init config params via configuration
arifBurakDemiray Jan 14, 2026
585fa29
fix: prevent double reset of conf module
arifBurakDemiray Jan 14, 2026
126b5d2
fix: prevent eq size getter to continue before init
arifBurakDemiray Jan 14, 2026
d61368f
fix: if is being disposed let endSession continue even if session tra…
arifBurakDemiray Jan 14, 2026
85d54f9
fix: eqsize getter of conf module, omit post-init change
arifBurakDemiray Jan 14, 2026
e37f200
fix: tests
arifBurakDemiray Jan 14, 2026
81bb314
fix: ASAN bug
arifBurakDemiray Jan 14, 2026
b1d549a
fix: resolve openssl path for apple silicon
arifBurakDemiray Mar 23, 2026
2e1d6a3
Use condition_variable for interruptible thread sleep
jslauthor Mar 17, 2026
fc10493
feat: configuration option for it
arifBurakDemiray Mar 23, 2026
3d6e5ad
refactor: add protections
arifBurakDemiray Mar 23, 2026
b670d82
feat: add changelog
arifBurakDemiray Mar 23, 2026
579fdd2
feat: add tests
arifBurakDemiray Mar 23, 2026
f51a431
fix: test for pointer arithmetic
arifBurakDemiray Mar 23, 2026
4e8e416
fix: increase wait time in test
arifBurakDemiray Mar 23, 2026
16ec656
Merge pull request #148 from Countly/resolve_openssl
turtledreams Mar 30, 2026
f9efa5f
Merge branch 'staging' into instant_stop
turtledreams Mar 30, 2026
e85d02b
feat: hour dow tz to events and requests
arifBurakDemiray Mar 31, 2026
0e5951b
feat: tests
arifBurakDemiray Mar 31, 2026
8b9cd57
feat: changelog
arifBurakDemiray Mar 31, 2026
e01831e
feat: sbs tests
arifBurakDemiray Apr 14, 2026
cb15477
fix: post manual tests
arifBurakDemiray Apr 15, 2026
84dc07c
Merge branch 'staging' into sbs
arifBurakDemiray Apr 15, 2026
b477749
fix: add test fix
arifBurakDemiray Apr 15, 2026
071c50e
fix: add timeout for ci
arifBurakDemiray Apr 15, 2026
399bded
fix: add back removed winhttp import during merge conflict
arifBurakDemiray Apr 15, 2026
ef77532
fix: import for ubuntu
arifBurakDemiray Apr 15, 2026
c7579fd
fix: review changes
arifBurakDemiray Apr 16, 2026
bff0026
feat: more ci options
arifBurakDemiray Apr 16, 2026
aacb09d
fix: tsan fix for test utils
arifBurakDemiray Apr 16, 2026
e0fcebe
fix: eq for sql
arifBurakDemiray Apr 16, 2026
a8e44f0
feat: changelog for missing functions
arifBurakDemiray Apr 16, 2026
8c3c5ed
fix: tests
arifBurakDemiray Apr 16, 2026
7de2b4e
Merge pull request #146 from Countly/sbs
turtledreams Apr 16, 2026
7f46c9d
Merge branch 'staging' into LoggingUpdate
arifBurakDemiray Apr 16, 2026
b091ffb
Merge pull request #150 from Countly/tz_hour_dow
turtledreams Apr 16, 2026
801e434
Merge branch 'staging' into instant_stop
arifBurakDemiray Apr 16, 2026
c3c6a7e
Update CMakeLists.txt
arifBurakDemiray Apr 16, 2026
7f175dd
feat: update logs
arifBurakDemiray Apr 16, 2026
075a1b4
Merge pull request #133 from Countly/LoggingUpdate
arifBurakDemiray Apr 16, 2026
4e47120
feat: 26.1.0
arifBurakDemiray Apr 16, 2026
c3118ef
Merge pull request #151 from Countly/2610
arifBurakDemiray Apr 16, 2026
f2c33e4
Merge branch 'staging' into instant_stop
arifBurakDemiray Apr 16, 2026
ebfaf3b
fix: tests
arifBurakDemiray Apr 16, 2026
c6e14e9
fix: tsan
arifBurakDemiray Apr 16, 2026
a33a7a4
fix: tsan
arifBurakDemiray Apr 16, 2026
644fcf7
Merge pull request #149 from Countly/instant_stop
arifBurakDemiray Apr 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
285 changes: 249 additions & 36 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,271 @@ on:
branches: [master, staging]

jobs:
doctests:
# ──────────────────────────────────────────────
# Core test matrix: OS × SQLite
# ──────────────────────────────────────────────
tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-15
- windows-2022

include:
os: [ubuntu-22.04, ubuntu-24.04, macos-15, windows-2022]
sqlite: [OFF, ON]
exclude:
# Windows has no system sqlite3.lib
- os: windows-2022
cmake-generator: -G "Visual Studio 17 2022" -A x64
cmake-install: "" #Already installed on hosted runner
dependencies: "" #Already installed on hosted runner
make: msbuild countly-tests.vcxproj -t:rebuild -verbosity:diag -property:Configuration=Release && .\Release\countly-tests.exe
- os: macos-15
cmake-install: "" #Already installed on hosted runner
dependencies: "" #Already installed on hosted runner
make: make ./countly-tests && ./countly-tests
- os: ubuntu-22.04
cmake-install: "" #Already installed on hosted runner
dependencies: |
sudo apt-get update && sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev
make: make ./countly-tests && ./countly-tests
sqlite: ON

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Update submodules
run: git submodule update --init --recursive
- name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update && sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
libsqlite3-dev

- name: Install CMake
run: ${{ matrix.cmake-install }}
- name: Set up MSVC
if: matrix.os == 'windows-2022'
uses: microsoft/setup-msbuild@v2

- name: Install dependencies
run: ${{ matrix.dependencies }}
- name: Configure (Unix)
if: matrix.os != 'windows-2022'
run: cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=${{ matrix.sqlite }} -B build .
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.31"

- name: Set up MSVC
- name: Configure (Windows)
if: matrix.os == 'windows-2022'
uses: microsoft/setup-msbuild@v1
run: cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=${{ matrix.sqlite }} -G "Visual Studio 17 2022" -A x64 -B build .
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.31"

- name: Build (Unix)
if: matrix.os != 'windows-2022'
run: cd build && make ./countly-tests

- name: Build (Windows)
if: matrix.os == 'windows-2022'
run: cd build && msbuild countly-tests.vcxproj -t:rebuild -verbosity:minimal -property:Configuration=Release

- name: Run tests (Unix)
if: matrix.os != 'windows-2022'
run: cd build && ./countly-tests

- name: Run tests (Windows)
if: matrix.os == 'windows-2022'
run: cd build && .\Release\countly-tests.exe

# ──────────────────────────────────────────────
# Sanitizers (Linux only, with SQLite)
# ──────────────────────────────────────────────
sanitizer-asan:
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
libsqlite3-dev

- name: Configure with ASAN
run: |
cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \
-DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" \
-DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address" \
-B build .
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.31"

- name: Build
run: cd build && make ./countly-tests

- name: Run tests
run: cd build && ./countly-tests
env:
ASAN_OPTIONS: "detect_leaks=1"

sanitizer-tsan:
runs-on: ubuntu-22.04
timeout-minutes: 120
# TSAN detects known threading issues tracked for future refactor.
# Runs for visibility but does not block the pipeline.
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
libsqlite3-dev

- name: Configure with TSAN
run: |
cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \
-DCMAKE_CXX_FLAGS="-fsanitize=thread" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \
-DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \
-B build .
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.31"

- name: Build
run: cd build && make ./countly-tests

- name: Run tests
run: cd build && ./countly-tests
env:
TSAN_OPTIONS: "second_deadlock_stack=1"

sanitizer-ubsan:
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
libsqlite3-dev

- name: Build and run tests
- name: Configure with UBSAN
run: |
cmake -DCOUNTLY_BUILD_TESTS=1 -B build . ${{ matrix.cmake-generator }}
cd build
${{ matrix.make }}
cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \
-DCMAKE_CXX_FLAGS="-fsanitize=undefined -fno-sanitize-recover=all" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=undefined" \
-DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=undefined" \
-B build .
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.31"

- name: Build
run: cd build && make ./countly-tests

- name: Run tests
run: cd build && ./countly-tests
env:
CMAKE_POLICY_VERSION_MINIMUM: 3.31
UBSAN_OPTIONS: "print_stacktrace=1"

# ──────────────────────────────────────────────
# Static library build (custom HTTP, no curl)
# ──────────────────────────────────────────────
static-build:
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libssl-dev \
libsqlite3-dev

- name: Configure static build
run: |
cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \
-DBUILD_SHARED_LIBS=OFF -DCOUNTLY_USE_CUSTOM_HTTP=ON \
-B build .
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.31"

- name: Build
run: cd build && make ./countly-tests

- name: Run tests
run: cd build && ./countly-tests

# ──────────────────────────────────────────────
# C++17 compatibility check
# ──────────────────────────────────────────────
cpp17:
runs-on: ubuntu-24.04
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
libsqlite3-dev

- name: Configure with C++17
run: |
cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \
-DCMAKE_CXX_STANDARD=17 \
-B build .
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.31"

- name: Build
run: cd build && make ./countly-tests

- name: Run tests
run: cd build && ./countly-tests

# ──────────────────────────────────────────────
# Clang on Linux
# ──────────────────────────────────────────────
clang-linux:
runs-on: ubuntu-24.04
timeout-minutes: 120
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
clang \
libcurl4-openssl-dev \
libssl-dev \
libsqlite3-dev

- name: Configure with Clang
run: |
cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-B build .
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.31"

- name: Build
run: cd build && make ./countly-tests

- name: Run tests
run: cd build && ./countly-tests
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ compile_commands.json
CTestTestfile.cmake
_deps
cmake-build-debug/

.DS_Store
test_results_*.log
*.db
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 26.1.0
- ! Minor breaking change ! SDK Behavior Settings is now enabled by default. Changes made on SDK Manager > SDK Behavior Settings on your server will affect SDK behavior directly.

- Added `enableImmediateRequestOnStop` configuration option. When enabled, the update loop uses a condition variable instead of polling, allowing `stop()` and `setUpdateInterval()` to take effect immediately rather than waiting for the current sleep interval to expire.
- Added init config method "disableSDKBehaviorSettingsUpdates" to disable periodic SBS updates from the server.
- Added init config method "setSDKBehaviorSettings" to provide server configuration in JSON format during initialization.

- Fixed OpenSSL discovery in CMakeLists.txt to dynamically resolve the Homebrew prefix, supporting both Apple Silicon and Intel Macs.
- Added `dow` (day of week) and `hour` fields to every event.
- Added `dow`, `hour`, and `tz` (timezone offset in minutes) fields to every request.

## 23.2.4
- Mitigated an issue where cached events were not queued when a user property was recorded.

## 23.2.3
- Mitigated an issue where the new device ID was used when ending a session if device ID was changed without merging.

Expand Down
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ add_library(countly
${CMAKE_CURRENT_SOURCE_DIR}/src/request_builder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/storage_module_db.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/storage_module_memory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/event.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/src/event.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/configuration_module.cpp)

target_include_directories(countly
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Expand All @@ -75,7 +76,10 @@ if (COUNTLY_USE_CUSTOM_SHA256)
else()
if (APPLE)
message("Setting openssl root for Mac")
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
execute_process(COMMAND brew --prefix openssl OUTPUT_VARIABLE OPENSSL_ROOT_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT OPENSSL_ROOT_DIR)
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
endif()
endif()
find_package(OpenSSL REQUIRED)
target_include_directories(countly PRIVATE ${OPENSSL_INCLUDE_DIR})
Expand Down Expand Up @@ -113,7 +117,9 @@ if(COUNTLY_BUILD_TESTS)
${CMAKE_CURRENT_SOURCE_DIR}/tests/event.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/crash.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/request.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/config.cpp)
${CMAKE_CURRENT_SOURCE_DIR}/tests/config.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/immediate_stop.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/sbs.cpp)

target_compile_options(countly-tests PRIVATE -g)
target_compile_definitions(countly-tests PRIVATE COUNTLY_BUILD_TESTS)
Expand Down Expand Up @@ -154,4 +160,4 @@ endif()
CXX_EXTENSIONS NO)
endif()

install(TARGETS countly ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/countly)
install(TARGETS countly ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/countly)
4 changes: 2 additions & 2 deletions examples/example_integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ int main() {
string _serverUrl = "https://your.server.ly";

if(_appKey.compare("YOUR_APP_KEY") == 0 || _serverUrl.compare("https://your.server.ly") == 0) {
cerr << "Please do not use default set of app key and server url" << endl;
printLog(LogLevel::WARNING, "[ExampleIntegration] Please do not use default set of app key and server url");
}

ct.start(_appKey, _serverUrl, 443, true);
Expand Down Expand Up @@ -276,7 +276,7 @@ int main() {
flag = false;
break;
default:
cout << "Option not found!" << endl;
printLog(LogLevel::DEBUG, "[ExampleIntegration] Please do not use default set of app key and server url");
break;
}
}
Expand Down
Loading
Loading