Conversation
- Introduced a new `trackIp` boolean property in the site configuration to enable tracking of user IP addresses. - Updated relevant components and API endpoints to support the new `trackIp` feature, ensuring it is properly integrated into site settings and analytics payloads. - Enhanced the database schema and request validation to accommodate the new tracking option, improving overall analytics capabilities.
- Updated the analytics API and response types to include the user's IP address in session details. - Enhanced the SessionDetails component to display the IP address when available, improving transparency in user session data. - Modified database queries to retrieve and return the IP address associated with each session, ensuring comprehensive analytics capabilities.
- Updated UserInfo type to include an optional IP address field. - Enhanced UserPage component to conditionally display the user's IP address using a Badge component. - Modified getUserInfo API to retrieve and return the user's IP address, ensuring comprehensive analytics data is available.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughAdds IP tracking capability: database schema updates (Postgres sites.trackIp, ClickHouse events.ip), server-side config/types and tracker pipeline changes (site config propagation, payload shape, conditional IP storage), API responses extended with ip fields, and client UI updates to toggle trackIp and display IP in session/user views. Minor docs formatting. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Tracker as Tracker Endpoint
participant Utils as createBasePayload
participant Queue as pageviewQueue
participant DB as ClickHouse/Postgres
Client->>Tracker: Tracking request (pageview/event)
Tracker->>Utils: createBasePayload(request, type, payload, siteConfiguration)
Utils-->>Tracker: Base payload (includes storeIp = siteConfiguration.trackIp)
Tracker->>Queue: Enqueue TotalTrackingPayload
Queue->>Queue: Build pageview record<br/>ip = storeIp ? ipAddress : null
Queue->>DB: Insert event (ip nullable)
Note over DB: ip persisted only when storeIp is true
sequenceDiagram
autonumber
participant UI
participant API as Server APIs
participant CH as ClickHouse
participant PG as Postgres
UI->>API: GET sessions / session / userInfo
API->>CH: Query events (select argMax(ip,...), any(ip))
CH-->>API: Rows with ip
API-->>UI: JSON including ip fields
UI->>API: GET/PUT site config (trackIp)
API->>PG: Read/Update sites.trackIp
PG-->>API: site config with trackIp
API-->>UI: Response including trackIp
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (19)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
UI Improvements
Documentation