BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

`webSocket` option passed to `createDirectLine` should be `boolean` instead of `WebSocket`

Open compulim opened this issue 3 years ago • 1 comments

Is it an issue related to Adaptive Cards?

  • [ ] Yes, this is an Adaptive Card issue but it is specific to Web Chat.

Do you have any screenshots?

image

(From https://github.com/microsoft/BotFramework-DirectLineJS/blob/master/src/directLine.ts#L369)

What version of Web Chat are you using?

Latest production

Which distribution are you using Web Chat from?

Unrelated

Which hosting environment does this issue primarily affect?

Others or unrelated

Which browsers and platforms do the issue happened?

No response

Which area does this issue affect?

Protocol or service

Is this an accessibility issue?

  • [ ] Yes, this is an accessibility issue.

Please describe the bug

The options passing to constructor of DirectLineJS is DirectLineOptions & Partial<Services>, which should produces:

type {
    secret?: string,
    token?: string,
    conversationId?: string,
    watermark?: string,
    domain?: string,
    webSocket?: boolean,
    pollingInterval?: number,
    streamUrl?: string,
    timeout?: number,
    botAgent?: string,
    conversationStartProperties?: any,

    scheduler: IScheduler;
    WebSocket: typeof WebSocket;
    ajax: AjaxCreationMethod;
    random: () => number;
}

However, when we type it out, we probably mistaken webSocket with WebSocket. Thus, our createDirectLine.ts should be boolean instead of WebSocket.

Do you see any errors in console log?

No response

How to reproduce the issue?

  1. Creates a TypeScript project
  2. Call createDirectLine({ webSocket: true })

What is the expected and actual behavior?

Expected: No TypeScript compile error should be produced.

Actual: Compile errors on webSocket.

Adaptive Card JSON

No response

Additional context

No response

compulim avatar Nov 23 '22 00:11 compulim

We've just discovered this. I see this is an old request, but if this is easily fixed for the next release that would be good. Seems like a simple fix.

Simon-Gregory-LG avatar Sep 19 '25 14:09 Simon-Gregory-LG