Skip to content

Updated Analytics#67

Merged
creatorcluster merged 3 commits into
creatorcluster:mainfrom
Coder-soft:main
Jul 26, 2026
Merged

Updated Analytics#67
creatorcluster merged 3 commits into
creatorcluster:mainfrom
Coder-soft:main

Conversation

@Coder-soft

Copy link
Copy Markdown

No description provided.

- Update @renderdragonorg/wisp from 0.1.1 to 0.2.0
- Replace custom fetch transport with built-in wispSecret config option
- Add bindSupabase() to auto-link auth state and enrich machine records
  with user email, name, and auth provider
- Add userEmail, userName, authProvider fields to machines Convex schema
- Handle session_identify events in analytics ingestion pipeline
- Surface enriched user fields in dashboard queries (machine stats,
  page visitors, machine search)
- Remove manual wisp.identify/reset from AuthProvider (now handled
  by bindSupabase)
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@Coder-soft is attempting to deploy a commit to the yamura3's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Coder-soft, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 80ed2329-bf9e-42f7-81bf-7081ecfab2db

📥 Commits

Reviewing files that changed from the base of the PR and between f5f9c3f and 3a52272.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • convex/dashboard.ts
  • convex/events.ts
  • convex/schema.ts
  • package.json
  • pnpm-workspace.yaml
  • public/albums_test.txt
  • src/main.tsx
  • src/providers/AuthProvider.tsx
  • supabase.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR upgrades Wisp and connects it to Supabase-backed identity enrichment.

  • Replaces the custom analytics transport and manual authentication lifecycle calls with Wisp 0.2.0 initialization and bindSupabase.
  • Persists email, name, and authentication provider on analytics machine records.
  • Returns the new identity fields from machine and visitor dashboard queries.
  • Adds Supabase integration documentation and updates dependency metadata.

Confidence Score: 2/5

This PR is not safe to merge until the public PII exposure and cross-machine identity attribution are fixed.

The changed queries disclose newly collected user profile data without authorization, while the ingestion path can persist that profile against unrelated machines when a batch contains multiple machine or identity contexts.

Files Needing Attention: convex/dashboard.ts and convex/events.ts

Security Review

The newly collected profile data is exposed through unauthenticated Convex queries, and batch-wide identity extraction can associate one user's PII with unrelated machines.

Important Files Changed

Filename Overview
convex/events.ts Adds identity persistence, but scopes the first identify payload to the whole batch rather than its originating machine.
convex/dashboard.ts Exposes newly stored PII from public queries without an authorization boundary.
convex/schema.ts Adds optional profile fields required by the analytics enrichment flow.
src/main.tsx Migrates Wisp initialization to version 0.2.0 and binds the Supabase client.
src/providers/AuthProvider.tsx Removes manual Wisp identity lifecycle handling in favor of the new binding.
package.json Upgrades the Wisp dependency from 0.1.1 to 0.2.0.

Sequence Diagram

sequenceDiagram
    participant U as Signed-in user
    participant W as Wisp client
    participant I as Convex ingestion
    participant M as Machine records
    participant Q as Public dashboard query
    participant C as Arbitrary caller
    U->>W: Supabase profile
    W->>I: Batch with session_identify
    I->>M: Store email/name/provider
    C->>Q: Query visitors or machine
    Q->>M: Read enriched record
    M-->>Q: Profile fields
    Q-->>C: Email/name/provider
Loading

Reviews (1): Last reviewed commit: "feat: integrate wisp analytics with Supa..." | Re-trigger Greptile

Comment thread convex/dashboard.ts Outdated
Comment on lines +384 to +389
country: machine?.country ?? null,
platform: machine?.platform ?? null,
userAgent: machine?.userAgent ?? null,
userEmail: machine?.userEmail ?? null,
userName: machine?.userName ?? null,
authProvider: machine?.authProvider ?? null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Public queries expose user identities

When an unauthenticated client calls getPageVisitors, this public query returns each visitor's email, name, and authentication provider without checking ctx.auth, causing authenticated users' profile data to be disclosed to arbitrary callers. The same fields are also exposed by the unguarded getMachineStats and searchMachines queries. How this was verified: The exported queries return the persisted profile fields directly and contain no authorization or ownership check.

Comment thread convex/events.ts Outdated
Comment on lines 147 to 158
const userInfo = extractUserInfo(sorted);

for (const event of sorted) {
const isBookkeeping = event.name === "session_start";
const isBookkeeping = event.name === "session_start" || event.name === "session_identify";

await upsertMachine(ctx, {
machineId: event.machineId,
userId: event.userId,
timestamp: event.timestamp,
meta: isBookkeeping ? event.payload : undefined,
userInfo,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 security Batch-wide identity contaminates machines

When a batch contains a session_identify event and events for another machine, extractUserInfo selects the first identity once and passes it to every upsertMachine call, causing the other machine to be stored and displayed with the wrong user's email, name, and authentication provider. Batches accept independently specified machine IDs without enforcing a single-machine invariant, and the geo ingestion path repeats this behavior. How this was verified: The batch validator permits different machine IDs while both handlers reuse one extracted profile across every event's machine upsert.

- Scope session_identify enrichment to the originating machine only,
  preventing cross-machine PII attribution (buildUserInfoMap)
- Gate PII fields (userEmail, userName, authProvider) in all dashboard
  queries behind ctx.auth.getUserIdentity() check
- Add pii() helper to consistently null out PII for unauthenticated callers
@creatorcluster
creatorcluster merged commit 3e393c9 into creatorcluster:main Jul 26, 2026
1 of 3 checks passed
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.

2 participants