Kenny
Kenny2mo ago

convex-swift subscriptions do not work when the convex client is authenticated

I'm experiencing an issue with the ConvexMobile Swift client where subscriptions fail to receive values when authentication is performed before subscription setup. The authentication succeeds, but the underlying Convex functions are never called. Environment: ConvexMobile Swift client version: 0.5.5 VersionInfo.swift:3 Authentication provider: Clerk Platform: iOS Convex Backend version: 1.24.1 Issue Details: 1. Authentication Flow: Using ConvexClientWithAuth with a custom ClerkProvider that implements the AuthProvider protocol 2. Problem: When I call convexClient.login() before setting up subscriptions, the subscriptions never receive values and the Convex functions are never executed on the backend 3. Current Coordination: I'm monitoring the authState publisher and only setting up subscriptions after receiving .authenticated state Logs:
UserManager initialized
AuthCheckView task got a clerk.user: nil
AuthCheckView task got a clerk.user: Optional("<redacted>")
UserManager didSet: clerkUser is not nil
isLoadingUser: false
error: nil
currentUser: nil
isCreatingProfile: false
profileCreationError: nil
subscriptionsInitialized: false
cancellables: []
ClerkProvider login: token: 1196
ClerkProvider extractIdToken: 1196
Convex authenticated, setting up subscriptions
UserManager setupUserSubscription: subscribing to user: <redacted>
// nothing afterwards. when i don't log in i see: UserManager setupUserSubscription: received user: //Optional("<redacted>")
UserManager initialized
AuthCheckView task got a clerk.user: nil
AuthCheckView task got a clerk.user: Optional("<redacted>")
UserManager didSet: clerkUser is not nil
isLoadingUser: false
error: nil
currentUser: nil
isCreatingProfile: false
profileCreationError: nil
subscriptionsInitialized: false
cancellables: []
ClerkProvider login: token: 1196
ClerkProvider extractIdToken: 1196
Convex authenticated, setting up subscriptions
UserManager setupUserSubscription: subscribing to user: <redacted>
// nothing afterwards. when i don't log in i see: UserManager setupUserSubscription: received user: //Optional("<redacted>")
Here is a deepwiki link that shows my conversation with devin about the problem: https://deepwiki.com/search/why-would-my-subscriptions-not_17ec9c2a-d968-4acf-9e51-9a78f374cfdc Would appreciate any help with this, been banging my head against it for a couple days now and happy to provide
DeepWiki
Search | DeepWiki
DeepWiki provides up-to-date documentation you can talk to, for every repo in the world. Think Deep Research for GitHub - powered by Devin.
2 Replies
Kenny
KennyOP2mo ago
Kenny
KennyOP2mo ago
AHA I FIXED IT! turns out it was because i forgot to set up an auth.config.ts file

Did you find this page helpful?