Client initialization race condition upon setting server URL #46

Closed
opened 2026-02-25 23:41:00 -08:00 by puregarlic · 0 comments
Owner

When a user sets the server URL, we fire a ConfigChangeEvent that the channels manager picks up and responds to. The issue is that this reaction is non-blocking; the frontend calls the set_server_url Tauri command, which successfully calls the method of the same name on the ConfigManager. This command does not include awaiting the process of creating a proper gRPC client; the frontend's await resolves, and then redirects the client to home.tsx.
At this point, though, when the page's clientLoader attempts to fetch available channels, the ConfigChangeEvent is not guaranteed to have been responded to, and the frontend fails to load the page with the infamouse no grpc client available error. To solve this issue, the ChannelsManager.connect method needs to be awaited in the logic chain after calling set_server_url.

When a user sets the server URL, we fire a `ConfigChangeEvent` that the channels manager picks up and responds to. The issue is that this reaction is non-blocking; the frontend calls the `set_server_url` Tauri command, which successfully calls the method of the same name on the `ConfigManager`. This command does not include awaiting the process of creating a proper gRPC client; the frontend's `await` resolves, and then redirects the client to `home.tsx`. At this point, though, when the page's `clientLoader` attempts to fetch available channels, the `ConfigChangeEvent` is not guaranteed to have been responded to, and the frontend fails to load the page with the infamouse `no grpc client available` error. To solve this issue, the `ChannelsManager.connect` method needs to be awaited in the logic chain after calling `set_server_url`.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
puregarlic/microclimate#46
No description provided.