fix: prevent wisp Not initialized errors from bindSupabase#69
Conversation
Coder-soft
commented
Jul 26, 2026
- 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
|
@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. |
|
Warning Review limit reached
Next review available in: 14 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR replaces Wisp’s Supabase binding with guarded, manual authentication lifecycle handling.
Confidence Score: 3/5This 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
|
| 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]
Reviews (1): Last reviewed commit: "fix: prevent wisp Not initialized errors..." | Re-trigger Greptile
| import wisp from "@renderdragonorg/wisp"; | ||
|
|
||
| function tryIdentify(userId: string) { | ||
| try { wisp.identify(userId); } catch { /* wisp not initialized */ } |
There was a problem hiding this comment.
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