Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: resolve actorId to username for consistent PostHog distinctId

Devin AIac2611a1a007
diff --git a/backend/src/services/secret/secret-queue.ts b/backend/src/services/secret/secret-queue.ts
index e62da6e1ba..3f5163c76b 100644
--- a/backend/src/services/secret/secret-queue.ts
+++ b/backend/src/services/secret/secret-queue.ts
@@ -1034,9 +1034,18 @@ export const secretQueueFactory = ({
isSynced: response?.isSynced ?? true
});
+ // Resolve the actor to a canonical telemetry distinct ID consistent with getTelemetryDistinctId
+ let telemetryDistinctId = `platform/${projectId}`;
+ if (isManual && actorId) {
+ const actor = await userDAL.findById(actorId);
+ if (actor) {
+ telemetryDistinctId = actor.username;
+ }
+ }
+
await telemetryService.sendPostHogEvents({
event: PostHogEventTypes.IntegrationSynced,
- distinctId: actorId ?? `platform/${projectId}`,
+ distinctId: telemetryDistinctId,
organizationId: project.orgId,
properties: {
integrationId: integration.id,