Client initialization race condition upon setting server URL #46
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
puregarlic/microclimate#46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a user sets the server URL, we fire a
ConfigChangeEventthat the channels manager picks up and responds to. The issue is that this reaction is non-blocking; the frontend calls theset_server_urlTauri command, which successfully calls the method of the same name on theConfigManager. This command does not include awaiting the process of creating a proper gRPC client; the frontend'sawaitresolves, and then redirects the client tohome.tsx.At this point, though, when the page's
clientLoaderattempts to fetch available channels, theConfigChangeEventis not guaranteed to have been responded to, and the frontend fails to load the page with the infamouseno grpc client availableerror. To solve this issue, theChannelsManager.connectmethod needs to be awaited in the logic chain after callingset_server_url.