Skip to content

Commit 8d2e9d1

Browse files
committed
feat: updates
1 parent c15e074 commit 8d2e9d1

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

src/main/services/posthog-analytics.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ export function trackAppEvent(
2929
return;
3030
}
3131

32+
properties = {
33+
...properties,
34+
$process_person_profile: false,
35+
};
36+
3237
posthogClient.capture({
33-
distinctId: "app-lifecycle", // Will be updated when user logs in
38+
distinctId: "app-event",
3439
event: eventName,
3540
properties,
3641
});

src/renderer/features/auth/stores/authStore.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const useAuthStore = create<AuthState>()(
114114
);
115115

116116
try {
117-
await client.getCurrentUser();
117+
const user = await client.getCurrentUser();
118118

119119
set({
120120
oauthAccessToken: tokenResponse.access_token,
@@ -133,7 +133,7 @@ export const useAuthStore = create<AuthState>()(
133133
get().scheduleTokenRefresh();
134134

135135
// Track user login
136-
identifyUser(`project-${projectId}`, {
136+
identifyUser(user.uuid, {
137137
project_id: projectId.toString(),
138138
region,
139139
});
@@ -319,7 +319,7 @@ export const useAuthStore = create<AuthState>()(
319319
);
320320

321321
try {
322-
await client.getCurrentUser();
322+
const user = await client.getCurrentUser();
323323

324324
set({
325325
isAuthenticated: true,
@@ -330,7 +330,7 @@ export const useAuthStore = create<AuthState>()(
330330
get().scheduleTokenRefresh();
331331

332332
// Track user identity on session restoration
333-
identifyUser(`project-${projectId}`, {
333+
identifyUser(user.uuid, {
334334
project_id: projectId.toString(),
335335
region: tokens.cloudRegion,
336336
});

src/renderer/features/tasks/stores/taskExecutionStore.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { getCloudUrlFromRegion } from "@/constants/oauth";
1818
import type {
1919
ExecutionMode as AnalyticsExecutionMode,
2020
ExecutionType,
21-
RepositoryProvider,
2221
} from "@/types/analytics";
2322

2423
interface ArtifactEvent {
@@ -375,21 +374,16 @@ export const useTaskExecutionStore = create<TaskExecutionStore>()(
375374
const currentTaskState = store.getTaskState(taskId);
376375

377376
// Track task run event
378-
const executionType: ExecutionType =
379-
currentTaskState.runMode === "cloud" ? "cloud" : "local";
377+
const executionType: ExecutionType = currentTaskState.runMode;
380378
const executionMode: AnalyticsExecutionMode =
381-
currentTaskState.executionMode === "plan" ? "plan" : "execute";
379+
currentTaskState.executionMode;
382380
const hasRepository = !!task.repository_config;
383-
const repositoryProvider: RepositoryProvider = hasRepository
384-
? "github"
385-
: "none";
386381

387382
trackTaskRun({
388383
task_id: taskId,
389384
execution_type: executionType,
390385
execution_mode: executionMode,
391386
has_repository: hasRepository,
392-
repository_provider: repositoryProvider,
393387
});
394388

395389
// Handle cloud mode - run task via API

src/renderer/lib/analytics.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ export function initializePostHog() {
2525
posthog.init(apiKey, {
2626
api_host: apiHost,
2727
ui_host: uiHost,
28-
person_profiles: "identified_only",
29-
capture_pageview: false, // We'll manually track page views if needed
28+
capture_pageview: false,
3029
capture_pageleave: false,
3130
});
3231

src/types/analytics.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export interface TaskRunProperties {
3030
execution_type: ExecutionType;
3131
execution_mode: ExecutionMode;
3232
has_repository: boolean;
33-
repository_provider: RepositoryProvider;
3433
}
3534

3635
export interface RepositorySelectProperties {

0 commit comments

Comments
 (0)