Repository navigation
Link members' app use to their account in product analytics - #396
Merged
Merged
Conversation
A member who also uses apps appeared twice: as user:<id> from the control plane and as app-user:<hash> from app sign-in. On sign-in, the control plane now aliases the person's app identities to their account: the identity apps issue when they sign in through Widefleet, and the company identity of each organization whose company sign-in the person has an account with. Company identities come from the person's accounts, so the first company sign-in links its identity even though the membership is added afterwards. The runtime and the control plane derive the analytics ID with the same contract function.
The Cloudflare request observer did not forward alias, so hosted sign-ins never linked app identities. Linking now reads the identities lazily, so installations without analytics run no extra queries at sign-in.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 31b229a | Nov 25 2026, 02:34 PM |
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.
Problem
With #395, a member who also uses apps appears as two people in product analytics:
user:<id>from the control plane andapp-user:<hash>from app sign-in.Change
appUserDistinctIdin@platform/contractsderives the app user ID from issuer and subject. The runtime and the control plane use it, so both produce the same ID.$create_aliasfromuser:<id>for each of the person's app identities:<PLATFORM_URL>/api/auth, user ID)createAppUserIdentityalready derives it, including Entra's object IDApp use before a person's next control-plane sign-in merges into their account when the alias arrives.
Verification
pnpm check$create_aliaswithdistinct_id: user:<id>app_user_activeevents merges into the account. That needs a separate test project.Stacked on #395.


Confidence Score: 5/5
The PR appears safe to merge; both previous findings are fixed.Summary
Links members' app identities to their control-plane account in product analytics.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Control-plane sign-in] --> B[Await observer alias] B --> C{Analytics enabled?} C -->|No| D[Skip identity lookups] C -->|Yes| E[Read app identity IDs] E --> F[Queue aliases for user account] F --> G[Drain analytics after request]Reviews (2) · Last reviewed commit: "Forward app identity links on Cloudflare..." · Reviewed by Greptile