Skip to content

Add new analytics events for group chats - #10830

Merged
ds-boyce merged 7 commits into
mainfrom
d/app-2240-chat-metrics
Jun 10, 2026
Merged

ds-boyce merged 7 commits into
mainfrom
d/app-2240-chat-metrics

Conversation

@ds-boyce

@ds-boyce ds-boyce commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

See src/analytics/metrics/types.ts for the new event types.

@ds-boyce
ds-boyce requested a review from mozzius June 9, 2026 21:50
@linear-code

linear-code Bot commented Jun 9, 2026

Copy link
Copy Markdown

APP-2240

@github-actions

github-actions Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor
Old size New size Diff
7.75 MB 7.76 MB 3.29 KB (0.04%)

@mozzius

mozzius commented Jun 10, 2026

Copy link
Copy Markdown
Member

@claude please review

@claude

claude Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @mozzius's task in 1m 48s —— View job


Code Review

Reviewed the full diff against origin/main. This is a clean, well-organized instrumentation PR — the event taxonomy in types.ts is nicely grouped (adoption / interactions / owner actions / problems), the convoId/isOwner payloads are consistent, and the refactor to hoist const convoId = convo.view.id reads well. A few things worth a look:

1. isNewAccount is always hardcoded false

src/components/intents/GroupChatJoinDialog.tsx:106 and :115 both emit:

ax.metric('groupchat:inviteLink:redeem', {isNewAccount: false})

The type declares isNewAccount: boolean, but it's false at every call site, so the dimension can never distinguish new vs. existing accounts — the data will be uniformly false. If detecting a freshly-created account isn't feasible here yet, consider dropping the field until it can be wired up (a dead dimension is easy to misread in dashboards). If it is feasible, this is the spot to compute it. Worth confirming this is intentional.

2. View events keyed on mutable effect deps may re-fire

groupchat:settings:view (ConversationSettings/index.tsx:364) runs in an effect with deps [ax, convoId, isOwner], and groupchat:landingPage:view (GroupChatJoinDialog.tsx) with [ax, hasSession] / JoinRequest.tsx with [ax].

ax is memoized so it's stable, but isOwner and hasSession are derived from query/session state and can flip after mount (e.g. isOwner resolving once the convo loads, or hasSession becoming true if the user logs in mid-flow). When they change, the effect re-runs and emits a second "view" — which can inflate view counts. If these are meant to be once-per-mount, consider a ref guard or firing on a stable signal. Low severity, but view-count accuracy is usually the point of these events.

3. groupchat:inviteLink:shared (method 'post') fires for any post containing an invite link

In Composer.tsx:1074-1085 the event fires whenever a submitted post contains a resolved chat-invite link, regardless of whether the link originated from the in-dialog "Post" share button. That's likely the intended semantic (count all shares, not just dialog-initiated ones), and it pairs sensibly with the separate groupchat:inviteLink:shareButton:press intent event — just flagging the distinction so it's understood that shareButton:press{method:'post'} and inviteLink:shared{method:'post'} are not 1:1 (a user can press Post then cancel, or paste a link directly). The loop will also emit once per invite link if a post somehow contains more than one.

Minor

  • groupchat:owner:inviteMember is emitted from two entry points (AddMembersLink.tsx and MessagesListGroupInfoPanel.tsx), both via useAddGroupMembers. Fine since they're distinct UI surfaces, just noting it for anyone reading the aggregate count.
  • Verified ax/useAnalytics() and ChatBskyGroupDefs are properly imported/in-scope at every new call site, the convoState.convo.kind === 'group' guard matches existing usage, and primaryMember?.did === currentAccount?.did for isOwner in MessagesList.tsx is consistent with the convention in ConversationSettings/index.tsx:206. 👍

Nothing here is blocking — #1 is the only one I'd want an answer on before merge.

@mozzius mozzius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm at a glance

@ds-boyce

Copy link
Copy Markdown
Contributor Author

3 is intended but I’m taking a look at 1 and 2.

Comment thread src/screens/Messages/JoinRequest.tsx Resolved
@arcalinea
arcalinea temporarily deployed to d/app-2240-chat-metrics - social-app PR #10830 June 10, 2026 20:37 — with Render Destroyed
@arcalinea
arcalinea temporarily deployed to d/app-2240-chat-metrics - social-app PR #10830 June 10, 2026 20:38 — with Render Destroyed
@ds-boyce
ds-boyce merged commit 871e950 into main Jun 10, 2026
19 checks passed
@ds-boyce
ds-boyce deleted the d/app-2240-chat-metrics branch June 10, 2026 20:56

This branch was successfully deployed

No deployments
d/app-2240-chat-metrics - social-app PR #10830 — b75a3d02 Deployed Jun 10, 2026 by arcalinea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants