-
Notifications
You must be signed in to change notification settings - Fork 6
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
Chat: register webview #35
Conversation
@@ -85,14 +90,15 @@ public void RegisterWebview(string handle) | |||
[JsonRpcMethod("webview/registerWebviewViewProvider")] | |||
public async Task RegisterWebviewViewProvider(string viewId, bool retainContextWhenHidden) | |||
{ | |||
System.Diagnostics.Debug.WriteLine(viewId, retainContextWhenHidden, "Agent registerWebviewViewProvider"); | |||
agentClientReady.Task.Wait(); |
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.
this makes sure agentClient is initialized and ready before we send the request to agent
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.
LGTM and working great!
await InitializeService.Initialize(AgentService); | ||
NotificationHandlers.SetAgentClient(AgentService); |
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.
It's better to call SetAgentClient before the agent initialization.
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.
The html will not start if i set agent client in Notification handlers before agent is initialized because some of the notifications were dropped? 🤔
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.
Ok, let's leave it as it is for now.
Run client.ResolveWebviewView after client has been initialized.