Skip to content

feat(telemetry): logout flow event#242

Merged
LorrisSaintGenez merged 1 commit into
feat/auth-flow-eventsfrom
feat/logout-telemetry
Jun 11, 2026
Merged

feat(telemetry): logout flow event#242
LorrisSaintGenez merged 1 commit into
feat/auth-flow-eventsfrom
feat/logout-telemetry

Conversation

@LorrisSaintGenez

@LorrisSaintGenez LorrisSaintGenez commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What

GROUT-351 — logout telemetry flow. Stacked on #239 (feat/auth-flow-events): it only needs the event catalog and TrackEvent helper from the auth step, nothing from the create/plan-change work.

  • auth logout emits CLI Auth Logout (flow: logout) before auth.ClearToken(), while the user identifier is still attached to the telemetry metadata — the event is attributed to the user signing out.
  • No event when already signed out (no logout actually happened).
  • No Identify at logout time: Segment's identity graph has no concept of un-identifying — once an anonymousId is aliased to a userId, the mapping persists by design.
  • Subsequent events automatically stop carrying userId: Track/Identify only set the field when the metadata has one, and after ClearToken() the next invocations load no token. Events fall back to anonymousId attribution, like a fresh install.

Test

# signed in: the final batch contains CLI Auth Logout {flow: logout}
DEBUG=1 go run ./cmd/algolia auth logout

# already signed out: no flow event
DEBUG=1 go run ./cmd/algolia auth logout

GROUT-351

@codacy-production

codacy-production Bot commented Jun 11, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity · 0 duplication

Metric Results
Complexity 5
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes.

@LorrisSaintGenez LorrisSaintGenez self-assigned this Jun 11, 2026
@LorrisSaintGenez LorrisSaintGenez marked this pull request as ready for review June 11, 2026 17:00
- auth logout tracks CLI Auth Logout {flow: logout} before
  auth.ClearToken(), while the user identifier is still attached to
  the telemetry metadata
- no event when already signed out, and no Identify at logout time:
  Segment's identity graph has no concept of un-identifying
- subsequent events already omit userId once the token is cleared
  (Track/Identify only set the field when the metadata carries one)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@LorrisSaintGenez LorrisSaintGenez changed the base branch from feat/create-planchange-flow-events to feat/auth-flow-events June 11, 2026 17:06
@LorrisSaintGenez LorrisSaintGenez merged commit ca71a88 into feat/auth-flow-events Jun 11, 2026
2 checks passed
@LorrisSaintGenez LorrisSaintGenez deleted the feat/logout-telemetry branch June 11, 2026 17:07
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.

1 participant