Skip to content

[CI] (4c70a79) javascript-node/native-http-contacts - #3862

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-4c70a79-javascript-node-native-http-contacts
Closed

[CI] (4c70a79) javascript-node/native-http-contacts#3862
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-4c70a79-javascript-node-native-http-contacts

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 4c70a79
App: javascript-node/native-http-contacts
App directory: apps/javascript-node/native-http-contacts
Workbench branch: wizard-ci-4c70a79-javascript-node-native-http-contacts
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-09T22:21:07.999Z
Duration: 347.9s

YARA Scanner

✓ 111 tool calls scanned, 0 violations detected

No violations: ✓ 111 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a server-only Node.js native HTTP contacts API using the posthog-node SDK. It adds event tracking for CRUD operations on contacts and groups, error tracking via captureException, and environment variable configuration. However, every capture() call is missing the required distinctId parameter, making the integration non-functional.

Files changed Lines added Lines removed
4 +69 -2

Confidence score: 5/5 🧙

  • Missing distinctId in all capture() calls: The posthog-node SDK requires a distinctId field in every capture() call. All four capture calls omit it, meaning events will either error or produce orphaned data with no user association. [CRITICAL]
  • enableExceptionAutocapture is not a valid posthog-node config option: This appears to be a hallucinated SDK option. The Node SDK does not support autocapture. It won't crash but signals a misunderstanding of the SDK. [MEDIUM]
  • No shutdown() call on process exit: The server never calls await posthog.shutdown(), so queued events may be lost on process termination (e.g., SIGTERM in containerized environments). [MEDIUM]

File changes

Filename Score Description
posthog.js 3/5 Creates PostHog client with env vars; uses invalid enableExceptionAutocapture option
index.js 2/5 Adds capture calls for CRUD events and error tracking, but all missing required distinctId
package.json 4/5 Adds posthog-node and dotenv dependencies
.env.example 5/5 Documents required environment variables

App sanity check ⚠️

Criteria Result Description
App builds and runs Yes No syntax errors; app will start and serve HTTP requests
Preserves existing env vars & configs Yes Existing app logic preserved; PostHog additions are additive
No syntax or type errors Yes Valid JavaScript throughout
Correct imports/exports Yes posthog-node and dotenv imported correctly
Minimal, focused changes Yes All changes relate to PostHog integration
Pre-existing issues None

Issues

  • Invalid enableExceptionAutocapture config option: This is not a recognized posthog-node configuration option. It will be silently ignored. Remove it from the init config. [MEDIUM]
  • No shutdown() on process exit: Add a process.on('SIGTERM', ...) handler that calls await posthog.shutdown() to flush pending events before the process exits. [MEDIUM]

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration is valid with correct dependency declarations
  • Graceful handling when PostHog env vars are missing (exports undefined, guarded with if (posthog))

PostHog implementation ❌

Criteria Result Description
PostHog SDKs installed Yes posthog-node ^5.51.8 added to package.json
PostHog client initialized Yes new PostHog(projectToken, { host }) in posthog.js with env vars
capture() No All four capture() calls are missing the required distinctId parameter
identify() N/A Server-only app
Error tracking No captureException(err) is called but without distinctId context; also uses invalid enableExceptionAutocapture config
Reverse proxy N/A Server-only app

Issues

  • Missing distinctId in all capture() calls: The posthog-node SDK requires distinctId as a mandatory field in every capture({ distinctId, event, properties }) call. All four calls (group_created, contact_created, contact_updated, contact_deleted) omit it entirely. This will cause runtime errors or produce events with no user association. Fix: extract a user identifier from the request (e.g., an auth header, session cookie, or IP-based fallback) and pass it as distinctId. [CRITICAL]
  • captureException without user context: posthog.captureException(err) is called without a distinctId, making it impossible to associate errors with users. Consider using posthog-node's context API or passing a distinctId explicitly. [CRITICAL]
  • Invalid enableExceptionAutocapture config: This option does not exist in the posthog-node SDK. Remove it. [MEDIUM]

Other completed criteria

  • API key loaded from POSTHOG_PROJECT_TOKEN environment variable
  • Host correctly configured from POSTHOG_HOST environment variable
  • Graceful fallback when env vars are not set (exports undefined)

PostHog insights and events ⚠️

Filename PostHog events Description
index.js group_created Tracks group creation with group_id property
index.js contact_created Tracks contact creation with contact_id, group_id, has_phone, has_company
index.js contact_updated Tracks contact updates with contact_id, group_id, updated_fields
index.js contact_deleted Tracks contact deletion with contact_id, group_id
index.js captureException Captures unhandled server errors in the catch block

Issues

  • All events non-functional due to missing distinctId: While the event names and properties are well-designed and would enable useful funnels (create → update → delete), none of them will work without a distinctId. [CRITICAL]

Other completed criteria

  • Events represent real user actions (CRUD operations on contacts and groups)
  • Events would enable product insights (contact lifecycle funnel, group adoption)
  • Events include enriched properties (e.g., updated_fields, has_phone, has_company)
  • No PII in event properties
  • Event names are descriptive and use consistent snake_case convention

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