feat(inbox): Capture "Signal source connected" analytics event#2380
Merged
Conversation
Fires when a user enables a signal source for the Inbox, either by toggling a non-warehouse source on directly or by completing the DataSourceSetup wizard for a warehouse source. `is_first_connection` distinguishes a brand-new config from a re-enable; `via_setup_wizard` distinguishes the OAuth path from a plain toggle. Lets us measure inbox onboarding (e.g. first-time-for-user trend of new users connecting their first source). Generated-By: PostHog Code Task-Id: 55527856-9edd-4907-a389-98ac880f806d
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/features/inbox/hooks/useSignalSourceManager.ts:431-435
The `track` call fires unconditionally inside the `try` block — even when `existing` is already truthy **and** `existing.enabled` is already `true`. In that case neither `createSignalSourceConfig` nor `updateSignalSourceConfig` is invoked, so no actual connection happened, yet a `Signal source connected` event is emitted. A concrete path to this state: a warehouse source's external-data-source row is deleted externally while the signal-source config stays enabled; the next toggle attempt opens the wizard, and completing it fires a spurious analytics event.
```suggestion
if (!existing || !existing.enabled) {
track(ANALYTICS_EVENTS.SIGNAL_SOURCE_CONNECTED, {
source_product: completedSource,
is_first_connection: !existing,
via_setup_wizard: true,
});
}
```
Reviews (1): Last reviewed commit: "feat(inbox): Capture "Signal source conn..." | Re-trigger Greptile |
charlesvien
approved these changes
May 27, 2026
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.
Summary
Signal source connectedanalytics event, fired from both signal-source connection paths inuseSignalSourceManager: the direct toggle (non-warehouse sources) and the post-DataSourceSetup-wizard completion (warehouse sources).source_product,is_first_connection(brand-new config vs. re-enable of an existing one), andvia_setup_wizard(warehouse OAuth path vs. plain toggle).Test plan
error_trackingfrom the Inbox sources settings → confirmSignal source connectedfires once withsource_product: "error_tracking",is_first_connection: true,via_setup_wizard: false. Toggle off then on again → second firing hasis_first_connection: false.session_replay→ same flow as above (non-warehouse path).github(or any warehouse source) via theDataSourceSetupwizard end-to-end → confirm one firing on completion withvia_setup_wizard: trueandis_first_connection: true.handleSetupCompletefails → confirm the event does not fire (it lives inside thetryblock, before thecatch).