Skip to content

Updated some stuff#66

Closed
Coder-soft wants to merge 2 commits into
creatorcluster:mainfrom
Coder-soft:main
Closed

Updated some stuff#66
Coder-soft wants to merge 2 commits into
creatorcluster:mainfrom
Coder-soft:main

Conversation

@Coder-soft

@Coder-soft Coder-soft commented Jul 12, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features
    • Enriched dashboard and machine search results with optional user identity fields (email, name, auth provider).
  • Refactor
    • Improved event processing to capture identity from session identify events and carry it through machine records.
    • Simplified Supabase auth handling and standardized Supabase↔Wisp integration.
  • Documentation
    • Added/expanded guidance on optional Supabase integration, identity handling, and related schema implications.
  • Chores
    • Added a test marker to the albums data file.
    • Updated the Wisp dependency and related workspace exclusion.

@vercel

vercel Bot commented Jul 12, 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 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Supabase authentication is bound to Wisp, identity metadata is extracted from session events, stored on machine records, and returned by dashboard queries. Documentation describes the integration, while an unrelated public test fixture gains one line of content.

Changes

Supabase identity enrichment

Layer / File(s) Summary
Bind Supabase authentication to Wisp
package.json, pnpm-workspace.yaml, src/main.tsx, src/providers/AuthProvider.tsx, supabase.md
Wisp is updated and bound to Supabase; authentication state handling no longer directly invokes Wisp, and integration usage is documented.
Persist identity metadata during event ingestion
convex/schema.ts, convex/events.ts, supabase.md
Optional email, name, and provider fields are extracted from session_identify events and inserted or preserved on machine records.
Expose identity metadata in dashboard queries
convex/dashboard.ts, supabase.md
Machine statistics, page visitors, and machine search results include nullable identity fields, with documented dashboard locations.

Test fixture update

Layer / File(s) Summary
Add test fixture content
public/albums_test.txt
Adds the first line, test, to the previously empty file.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Supabase
  participant bindSupabase
  participant Wisp
  participant Convex
  participant Dashboard
  Supabase->>bindSupabase: auth state change
  bindSupabase->>Wisp: identify or reset
  Wisp->>Convex: session_identify event
  Convex->>Convex: persist machine identity metadata
  Dashboard->>Convex: query machine data
  Convex-->>Dashboard: return identity fields
Loading

Possibly related PRs

Poem

A bunny bound Supabase tight,
And stored new names in fields of light.
Wisp carried the trace,
Dashboard showed the face—
While “test” hopped in just right.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too vague to describe the main change in the pull request. Use a concise title that names the primary change, such as adding Supabase identity binding and machine user metadata.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a small static test file under the public assets directory. The main change is:

  • Added public/albums_test.txt with the text test.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
public/albums_test.txt Adds a new public static text file with no observed conflict with the app's album data or asset paths.

Reviews (1): Last reviewed commit: "Updated some stuff" | Re-trigger Greptile

- 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)
@Coder-soft Coder-soft closed this Jul 26, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@convex/dashboard.ts`:
- Around line 283-285: Restrict the new userEmail, userName, and authProvider
fields returned by getMachineStats, getPageVisitors, and searchMachines to
authenticated, tenant-scoped callers. Add the existing authorization and tenant
checks to these public query handlers, or remove/gate the identity fields so
unauthenticated callers cannot retrieve PII.

In `@convex/events.ts`:
- Around line 132-157: The recordBatch and corresponding event-processing
handler must scope extracted identity data to each machine/session instead of
reusing one batch-wide extractUserInfo result. Track identity state per target
while iterating events, update it for each session_identify event, and pass only
that target’s current identity to upsertMachine; add tests covering multiple
machines and identity changes within a batch.

In `@supabase.md`:
- Line 90: Update the diagram’s opening Markdown code fence at line 90 to
specify the text language, using the existing diagram content unchanged.
- Around line 25-27: Update the Supabase createClient example to read the
repository’s VITE_SUPABASE_PUBLISHABLE_KEY environment variable instead of
VITE_SUPABASE_ANON_KEY, while keeping the URL argument unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 86a4aa1b-7c12-423f-b7fc-31b867f99725

📥 Commits

Reviewing files that changed from the base of the PR and between 3554aa6 and 31141fb.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • convex/dashboard.ts
  • convex/events.ts
  • convex/schema.ts
  • package.json
  • pnpm-workspace.yaml
  • src/main.tsx
  • src/providers/AuthProvider.tsx
  • supabase.md
💤 Files with no reviewable changes (1)
  • src/providers/AuthProvider.tsx

Comment thread convex/dashboard.ts
Comment on lines +283 to +285
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.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Gate the new PII before returning it.

getMachineStats, getPageVisitors, and searchMachines now return email/name/provider, but the supplied dashboard handlers are public querys without an auth or tenant check. Anyone able to call these endpoints can retrieve user PII; add authorization and tenant scoping, or keep identity fields behind authenticated endpoints. (raw.githubusercontent.com)

Also applies to: 387-389, 442-444

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@convex/dashboard.ts` around lines 283 - 285, Restrict the new userEmail,
userName, and authProvider fields returned by getMachineStats, getPageVisitors,
and searchMachines to authenticated, tenant-scoped callers. Add the existing
authorization and tenant checks to these public query handlers, or remove/gate
the identity fields so unauthenticated callers cannot retrieve PII.

Comment thread convex/events.ts
Comment on lines +132 to +157
function extractUserInfo(events: Array<{ name: string; payload?: unknown }>): { email?: string; name?: string; provider?: string } | undefined {
const identifyEvent = events.find((e) => e.name === "session_identify");
if (!identifyEvent?.payload || typeof identifyEvent.payload !== "object") return undefined;
const p = identifyEvent.payload as Record<string, unknown>;
const email = typeof p.email === "string" ? p.email : undefined;
const name = typeof p.name === "string" ? p.name : undefined;
const provider = typeof p.provider === "string" ? p.provider : undefined;
return email || name || provider ? { email, name, provider } : undefined;
}

export const recordBatch = mutation({
args: { events: v.array(eventValidator) },
handler: async (ctx, { events }) => {
// Process oldest-first so ordering-dependent bookkeeping (session creation, counters) is correct.
const sorted = [...events].sort((a, b) => a.timestamp - b.timestamp);
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.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Scope identity extraction to the machine/session being processed.

extractUserInfo(sorted) finds one session_identify event across the entire batch, then both handlers pass that object to every upsertMachine. A batch containing multiple machines or identity changes will assign the first user’s PII to unrelated machines and ignore later identities. Maintain identity state per target while processing events, and add multi-machine/multi-identity tests.

Also applies to: 233-244

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@convex/events.ts` around lines 132 - 157, The recordBatch and corresponding
event-processing handler must scope extracted identity data to each
machine/session instead of reusing one batch-wide extractUserInfo result. Track
identity state per target while iterating events, update it for each
session_identify event, and pass only that target’s current identity to
upsertMachine; add tests covering multiple machines and identity changes within
a batch.

Comment thread supabase.md
Comment on lines +25 to +27
const supabase = createClient(
import.meta.env.VITE_SUPABASE_URL,
import.meta.env.VITE_SUPABASE_ANON_KEY

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the repository’s publishable-key environment variable.

The app’s Supabase client reads VITE_SUPABASE_PUBLISHABLE_KEY, not VITE_SUPABASE_ANON_KEY; following this example with the repository’s environment will pass the wrong value to createClient. (raw.githubusercontent.com)

Proposed fix
-  import.meta.env.VITE_SUPABASE_ANON_KEY
+  import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const supabase = createClient(
import.meta.env.VITE_SUPABASE_URL,
import.meta.env.VITE_SUPABASE_ANON_KEY
const supabase = createClient(
import.meta.env.VITE_SUPABASE_URL,
import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase.md` around lines 25 - 27, Update the Supabase createClient example
to read the repository’s VITE_SUPABASE_PUBLISHABLE_KEY environment variable
instead of VITE_SUPABASE_ANON_KEY, while keeping the URL argument unchanged.

Comment thread supabase.md

## Data flow

```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Specify a language for the diagram fence.

Change the opening fence at Line [90] to ```text so markdownlint MD040 passes.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 90-90: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase.md` at line 90, Update the diagram’s opening Markdown code fence at
line 90 to specify the text language, using the existing diagram content
unchanged.

Source: Linters/SAST tools

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