Skip to content

Conversation

mattt
Copy link
Contributor

@mattt mattt commented May 6, 2025

See #97 (comment)

Other SDKs have clients automatically send initialize message when connecting to a server. This PR updates our implementation to do the same. Beyond consistency, this helps mitigate an invisible time dependency / race condition for clients with streamable HTTP transport, as the client waits for a session ID before subscribing to SSE events. If the API consumer failed to call initialize immediately after connecting, this could result in SSE subscriptions timing out.

This PR deprecates the existing Client.initialize method. This method will be removed in a future version (or more accurately, it will be made private and replace the current private func _initialize method).

@mattt mattt force-pushed the mattt/initialize-on-connect branch from e257521 to 297bf63 Compare May 26, 2025 12:18
@mattt mattt merged commit a59b50b into main May 26, 2025
6 checks passed
@mattt mattt deleted the mattt/initialize-on-connect branch May 26, 2025 13:04
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.

1 participant