-
Notifications
You must be signed in to change notification settings - Fork 3
Fix Expo user attribute removal docs #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,17 @@ | ||
| import { createFileRoute } from "@tanstack/react-router"; | ||
| import { createDocsSearchApi } from "@/lib/search"; | ||
|
|
||
| let server: | ||
| | ReturnType<typeof createDocsSearchApi> | ||
| | null = null; | ||
| type DocsSearchServer = { | ||
| GET(request: Request): Response | Promise<Response>; | ||
| }; | ||
|
|
||
| function getServer() { | ||
| let server: DocsSearchServer | null = null; | ||
|
|
||
| async function getServer() { | ||
| if (server) return server; | ||
|
|
||
| // In development, the fetch-based search client still hits this route. | ||
| // The production client loads a prebuilt FlexSearch index instead. | ||
| const { createDocsSearchApi } = await import("@/lib/search"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Search server double initializationMedium Severity
Reviewed by Cursor Bugbot for commit 1f1ee1d. Configure here. |
||
| server = createDocsSearchApi(); | ||
|
|
||
| return server; | ||
|
|
@@ -23,6 +25,6 @@ export const Route = createFileRoute("/api/search")({ | |
| }, | ||
| }); | ||
|
|
||
| export function handleSearchGet(request: Request) { | ||
| return getServer().GET(request); | ||
| export async function handleSearchGet(request: Request) { | ||
| return (await getServer()).GET(request); | ||
| } | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Expo users trying to react to a paywall Set user attributes action, this points them to
onUserAttributesChange, but the currentexpo-superwallevent surface does not define or dispatch that callback: I checked upstreamsrc/SuperwallEventCallbacks.tsandsrc/internal/superwallEventBridge.ts, and the callback list/switch only includes the existing paywall, subscription, log, purchase, and custom-callback events. Following this quickstart would therefore compile against a nonexistent callback (or never fire if forced through types); please document the supported Expo path or add the bridge before referencing it here.Useful? React with 👍 / 👎.