Skip to content

Dart WebSocket client template doesn't support query parameters from channel bindings #1958

Description

@batchu5

The Dart WebSocket client template doesn't extract or use query parameters defined in channel bindings, unlike the Python template. This prevents authentication tokens and other important parameters from being passed to WebSocket connections.

When a channel defines query parameters in its bindings (e.g., auth_token for authentication), the generated JavaScript client should:

  1. Accept these parameters in the constructor
  2. Automatically append them to the WebSocket URL as query strings
// Expected generated code
ExampleClient({String? url, String? auth_token})
  : _url = _buildUrl(url ?? 'wss://default-url', auth_token);

static String _buildUrl(String baseUrl, String? authToken) {
  if (authToken == null) return baseUrl;
  return '$baseUrl?auth_token=$authToken';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions