Skip to content

fix: prevent wisp Not initialized errors from bindSupabase#69

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

fix: prevent wisp Not initialized errors from bindSupabase#69
creatorcluster merged 2 commits into
creatorcluster:mainfrom
Coder-soft:main

Conversation

@Coder-soft

Copy link
Copy Markdown
  • Remove bindSupabase() call — its onAuthStateChange callback lacks try-catch and throws when wisp init timing is delayed
  • Restore manual tryIdentify/tryReset with try-catch guards in AuthProvider, matching the original safe pattern
  • Keep metadata enrichment: track session_identify event with email/name/provider on sign-in and existing session recovery

- Remove bindSupabase() call — its onAuthStateChange callback lacks
  try-catch and throws when wisp init timing is delayed
- Restore manual tryIdentify/tryReset with try-catch guards in
  AuthProvider, matching the original safe pattern
- Keep metadata enrichment: track session_identify event with
  email/name/provider on sign-in and existing session recovery
@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: 14 seconds

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: 1c785f7b-8877-40e1-9f42-8342752bb290

📥 Commits

Reviewing files that changed from the base of the PR and between 503f933 and 2c59e75.

📒 Files selected for processing (2)
  • src/main.tsx
  • src/providers/AuthProvider.tsx
✨ 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 replaces Wisp’s Supabase binding with guarded, manual authentication lifecycle handling.

  • Removes bindSupabase from application startup.
  • Identifies or resets the Wisp session from Supabase authentication events.
  • Emits enriched session_identify metadata for sign-ins and recovered sessions.

Confidence Score: 3/5

This PR should not merge until delayed Wisp initialization still results in eventual identification and metadata tracking.

The new guards prevent initialization exceptions from escaping, but they permanently discard the only identify and session_identify attempts made for the current recovered or newly signed-in session.

Files Needing Attention: src/providers/AuthProvider.tsx

Important Files Changed

Filename Overview
src/main.tsx Removes automatic Supabase binding while retaining conditional Wisp initialization.
src/providers/AuthProvider.tsx Adds manual identity lifecycle and metadata tracking, but transient initialization failures permanently drop identification and tracking.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Initialize Wisp] --> B[Mount AuthProvider]
    B --> C{Supabase auth result}
    C -->|SIGNED_IN| D[Try identify and track]
    C -->|Existing session| D
    C -->|SIGNED_OUT| E[Try reset]
    D --> F{Wisp ready?}
    F -->|Yes| G[Associate telemetry with user]
    F -->|No| H[Catch and discard error]
    H --> I[No retry after initialization]
Loading

Reviews (1): Last reviewed commit: "fix: prevent wisp Not initialized errors..." | Re-trigger Greptile

Comment thread src/providers/AuthProvider.tsx Outdated
import wisp from "@renderdragonorg/wisp";

function tryIdentify(userId: string) {
try { wisp.identify(userId); } catch { /* wisp not initialized */ }

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 Initialization failures drop identity

When Wisp initialization completes after Supabase reports a new or recovered session, these catch blocks discard the failed identification and tracking attempts without retrying them, causing the current session's telemetry to remain anonymous and lose its session_identify metadata.

- When identify/track fails because wisp isn't ready, retry up to 3
  times with 500ms delay via setTimeout instead of silently dropping
@creatorcluster
creatorcluster merged commit 7e63459 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