-
Notifications
You must be signed in to change notification settings - Fork 61
Send telemetry info using specific id's associated to users to calculate DAU/WAU/MAU in posthog #3097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
imrishabh18
wants to merge
12
commits into
main
Choose a base branch
from
telemetry-dau
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Send telemetry info using specific id's associated to users to calculate DAU/WAU/MAU in posthog #3097
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5b33b12
Send telemetry info using specific id's associated to users to calcul…
imrishabh18 7c8f7ed
update tscircuit
imrishabh18 f4db6b3
update bun lock
imrishabh18 182d482
update props
imrishabh18 31e8838
try
imrishabh18 cc9212f
downgrade props
imrishabh18 563ca0a
debug
imrishabh18 e134bd5
updt
imrishabh18 9d86106
source of cj
imrishabh18 b8453a4
fix
imrishabh18 23aaadf
remove debug lines
imrishabh18 331fae8
updt
imrishabh18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { rm } from "node:fs/promises" | ||
| import { temporaryDirectory } from "tempy" | ||
| import { expect, test } from "bun:test" | ||
| import { getCliConfig } from "lib/cli-config" | ||
| import { getTelemetryDistinctId } from "lib/telemetry" | ||
|
|
||
| test("telemetry distinct id is stable for anonymous users", async () => { | ||
| const configDir = temporaryDirectory() | ||
| const config = getCliConfig({ configDir }) | ||
|
|
||
| try { | ||
| const firstDistinctId = getTelemetryDistinctId(config) | ||
| const secondDistinctId = getTelemetryDistinctId(config) | ||
|
|
||
| expect(firstDistinctId).toBe(secondDistinctId) | ||
| expect(firstDistinctId).toStartWith("anonymous:") | ||
| expect(config.get("telemetryAnonymousId")).toBe( | ||
| firstDistinctId.replace("anonymous:", ""), | ||
| ) | ||
| } finally { | ||
| config.clear() | ||
| await rm(configDir, { recursive: true, force: true }) | ||
| } | ||
| }) | ||
|
|
||
| test("telemetry distinct id uses account id for authenticated users", async () => { | ||
| const configDir = temporaryDirectory() | ||
| const config = getCliConfig({ configDir }) | ||
|
|
||
| try { | ||
| config.set("accountId", "account-123") | ||
|
|
||
| expect(getTelemetryDistinctId(config)).toBe("account:account-123") | ||
| expect(config.get("telemetryAnonymousId")).toBeUndefined() | ||
| } finally { | ||
| config.clear() | ||
| await rm(configDir, { recursive: true, force: true }) | ||
| } | ||
| }) |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each cli command taking 1s is wayyyy too long. An abortsignal needs to be sent at the end of every command