Skip to content
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

Merged
merged 6 commits into from
Aug 13, 2024
Merged

Chat: register webview #35

merged 6 commits into from
Aug 13, 2024

Conversation

abeatrix
Copy link
Collaborator

Run client.ResolveWebviewView after client has been initialized.

@@ -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();
Copy link
Collaborator Author

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

Copy link
Collaborator

@PiotrKarczmarz PiotrKarczmarz left a 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);
Copy link
Collaborator

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.

Copy link
Collaborator Author

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? 🤔

Copy link
Collaborator

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.

@abeatrix abeatrix merged commit c144cba into main Aug 13, 2024
@abeatrix abeatrix deleted the bee/workaround branch August 13, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants