Skip to content

[CI] (8dccaac) android/Jetchat - #2343

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-8dccaac-android-Jetchat
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-8dccaac-android-Jetchat

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 8dccaac
App: android/Jetchat
App directory: apps/android/Jetchat
Workbench branch: wizard-ci-8dccaac-android-Jetchat
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-07-03T00:19:12.582Z
Duration: 509.8s

YARA Scanner

✓ 70 tool calls scanned, 0 violations detected

No violations: ✓ 70 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog analytics into the Jetchat Android (Kotlin/Jetpack Compose) sample app. A new JetchatApplication class initializes the PostHog Android SDK via BuildConfig fields sourced from local.properties. Twelve custom events are captured across six files covering auth, messaging, voice recording, emoji/attachment selectors, profile views, channel switching, and widget pinning. User identification is called at login and reset at logout.

Files changed Lines added Lines removed
10 +151 -10

Confidence score: 3/5 🤔

  • PostHog.identify() uses wrong parameter name: The call PostHog.identify(distinctId = username, properties = mapOf(...)) uses properties instead of the correct userProperties. In Kotlin, this is a named-argument compile error — the SDK method signature is identify(distinctId, userProperties, userPropertiesSetOnce). This will prevent the app from building. [CRITICAL]
  • Username used as distinct_id: Raw usernames are used as distinctId values. In this fake-auth demo any string is accepted, which can produce collisions and makes the identifier PII-adjacent. A stable internal ID is preferred. [MEDIUM]
  • PII in event properties: user_logged_in sends "username" in event-level properties. Usernames are PII and should be set via person properties (userProperties in identify or ``), not in capture() event properties. [MEDIUM]
  • No env example file committed: The report mentions adding posthog.apiKey/posthog.host to a local.properties.example, but no such file is included in the PR. Collaborators have no guidance on which keys to set. [MEDIUM]

File changes

Filename Score Description
app/build.gradle.kts 4/5 Adds PostHog dependency, BuildConfig fields sourced from local.properties, enables buildConfig. Clean integration.
AndroidManifest.xml 4/5 Registers JetchatApplication via android:name. Minimal, correct change.
JetchatApplication.kt 5/5 New Application class with PostHog init in onCreate(). Enables lifecycle events, screen views, deep links, session replay, and error autocapture. Follows docs exactly.
MainViewModel.kt 2/5 Identify uses wrong parameter name (properties → userProperties). Username as distinct_id is fragile. PII in event properties.
JetchatDrawer.kt 5/5 Captures channel_switched with channel name, widget_added_to_home_screen. Good event placement.
Conversation.kt 5/5 Captures message_sent with channel and length, drag_drop_message_received. Well-placed with useful properties.
RecordButton.kt 4/5 Captures voice recording lifecycle events. Minor: voice_recording_cancelled fires on onDragCancel even if recording never started (when onStartRecording returned false).
UserInput.kt 5/5 Captures attachment_selector_opened with type and emoji_selected with emoji value. Good granularity.
ProfileFragment.kt 5/5 Captures profile_viewed with user ID.
posthog-setup-report.md N/A Documentation/report file.

App sanity check ⚠️

Criteria Result Description
App builds and runs No PostHog.identify(properties = ...) uses an invalid named parameter — should be userProperties. This is a Kotlin compile error.
Preserves existing env vars & configs Yes Existing configs and code preserved; only PostHog additions made.
No syntax or type errors No Wrong named parameter in identify() call is a type/syntax error.
Correct imports/exports Yes All imports (com.posthog.PostHog, com.posthog.android.*) are correct.
Minimal, focused changes Yes All changes are PostHog-related with no scope creep.
Pre-existing issues NavActivity missing android:label The main activity lacks android:label, which means automatic screen view tracking will fall back to the activity class name. Not introduced by this PR.

Issues

  • Wrong identify() parameter name: PostHog.identify(distinctId = username, properties = mapOf(...)) uses properties which does not exist on the SDK's identify method. The correct parameter name is userProperties. This will cause a compile-time error. [CRITICAL]
  • No local.properties.example committed: The posthog.apiKey and posthog.host keys are read from local.properties but no example file is committed to guide collaborators. [MEDIUM]

Other completed criteria

  • Build configuration correctly enables buildConfig = true and adds the PostHog dependency
  • Existing app code and functionality preserved — no deletions of meaningful code
  • Changes are minimal and focused on PostHog integration only

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes com.posthog:posthog-android:3.+ added to build.gradle.kts dependencies.
PostHog client initialized Yes PostHogAndroid.setup(this, config) called in JetchatApplication.onCreate() with lifecycle events, screen views, deep links, session replay, and error autocapture enabled. Follows docs pattern exactly.
capture() Yes 12 distinct PostHog.capture() calls across 6 files covering core user flows.
identify() No Uses wrong parameter name properties instead of userProperties. Also uses raw username as distinctId, which is fragile and PII-adjacent.
Error tracking Yes errorTrackingConfig.autoCapture = true enabled in SDK config — correct per docs.
Reverse proxy N/A Android mobile app — ad blockers do not apply; reverse proxy is not needed.

Issues

  • identify() incorrect parameter: PostHog.identify(distinctId = username, properties = mapOf("username" to username)) — properties is not a valid parameter on the Android SDK identify method. Must use userProperties. [CRITICAL]
  • Username as distinct_id: Using a raw username (from fake auth that accepts anything) as distinctId is fragile. Two users entering the same username would be merged. A stable internal ID is preferred. [MEDIUM]

Other completed criteria

  • API key loaded from BuildConfig.POSTHOG_API_KEY sourced from local.properties — not hardcoded
  • Host correctly defaults to https://us.i.posthog.com via BuildConfig
  • PostHog.reset() correctly called on logout before clearing state
  • Session replay enabled via sessionReplay = true
  • Autocapture of lifecycle events, screen views, and deep links enabled

PostHog insights and events ⚠️

Filename PostHog events Description
MainViewModel.kt user_logged_in, user_logged_out Auth flow tracking with identify on login and reset on logout
Conversation.kt message_sent, drag_drop_message_received Core messaging actions with channel name and message length
RecordButton.kt voice_recording_started, voice_recording_completed, voice_recording_cancelled Voice recording lifecycle funnel
UserInput.kt attachment_selector_opened, emoji_selected Input feature engagement with selector type and emoji value
ProfileFragment.kt profile_viewed Profile navigation with user ID
JetchatDrawer.kt channel_switched, widget_added_to_home_screen Navigation and widget actions

Issues

  • PII in event properties: user_logged_in includes "username" in capture() event properties. Usernames are PII and should be set via person properties (e.g., userProperties in identify() or `` in capture()), not as event-level properties. [MEDIUM]

Other completed criteria

  • All 12 events represent real user actions (login, messaging, recording, navigation, etc.)
  • Events enable product insights — voice recording funnel, messaging trends, feature engagement, retention via login/logout
  • Events include relevant contextual properties (channel name, message length, selector type, emoji, profile user ID)
  • Event names follow consistent snake_case convention and are descriptive of the action

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants