From 33c3748d1ecd215c084830756b1c4fd6a6b90150 Mon Sep 17 00:00:00 2001 From: Igor Ilic Date: Mon, 11 Nov 2024 11:53:09 +0100 Subject: [PATCH] refactor: Renamed .anonymous_id file to anon_id Renamed .anonymous_id file to anon_id Refactor #COG-492 --- .gitignore | 1 + cognee/shared/utils.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fef10cd63..f447655cf 100644 --- a/.gitignore +++ b/.gitignore @@ -177,5 +177,6 @@ cognee/cache/ # Default cognee system directory, used in development .cognee_system/ .data_storage/ +.anon_id node_modules/ diff --git a/cognee/shared/utils.py b/cognee/shared/utils.py index 1b5fb9de8..41f3928ca 100644 --- a/cognee/shared/utils.py +++ b/cognee/shared/utils.py @@ -22,7 +22,7 @@ def get_anonymous_id(): if not os.path.isdir(home_dir): os.makedirs(home_dir, exist_ok=True) - anonymous_id_file = os.path.join(home_dir, ".anonymous_id") + anonymous_id_file = os.path.join(home_dir, ".anon_id") if not os.path.isfile(anonymous_id_file): anonymous_id = str(uuid4()) with open(anonymous_id_file, "w", encoding="utf-8") as f: @@ -52,6 +52,7 @@ def send_telemetry(event_name: str, user_id, additional_properties: dict = {}): **additional_properties, } + # Needed to forward properties to PostHog along with id posthog.identify(get_anonymous_id(), properties) try: