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

No welcome message in react despite userID set

Open benferns opened this issue 1 year ago • 1 comments

Is it an issue related to Adaptive Cards?

No

Is this an accessibility issue?

No

What version of Web Chat are you using?

Latest production

Which distribution are you using Web Chat from?

NPM

Which hosting environment does this issue primarily affect?

Web apps

Which browsers and platforms do the issue happened?

Browser: Chrome (latest), Browser: Safari (latest)

Which area does this issue affect?

Chat history

Which theme pack does this issue affect?

I did not test it on other theme packs

What is the public URL for the website?

No response

Please describe the bug

I have what I believe to be the simplest possible react setup to get the chatbot window open and running (via secret for now, not token). As far as I can tell from the docs this should trigger a welcome message, but doesn't.

I've confirmed a random user ID is set in the payload POSTed to https://directline.botframework.com/v3/directline/conversations . I've tried using and omitting the userID prop (docs seemed to suggest whether it was omitted or prefixed with dl_ , a random one would be generated regardless?)

import React, { useMemo } from "react";
import ReactWebChat, { createDirectLine } from "botframework-webchat";

function ChatBot() {
  const directLine = useMemo(
    () =>
      createDirectLine({
        token:
          "SECRET_HERE",
      }),
    []
  );

  return (
      <ReactWebChat directLine={directLine} userID="dl_throwaway" />
  );
}

export default ChatBot;

(On a side note, I've found the docs & API quite difficult to explore & understand while getting started with a react setup)

Do you see any errors in console log?

many instances of "Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead." which I'm taking to be an unrelated issue

How to reproduce the issue?

  1. Create react project
  2. Paste component above into project and add to root

What do you expect?

Set welcome flow to appear, as per iframe embed.

What actually happened?

No messages received

Do you have any screenshots or recordings to repro the issue?

No response

Adaptive Card JSON

No response

Additional context

No response

benferns avatar May 07 '24 07:05 benferns

@benferns - Thank you for your patience. Are you still experiencing an issue with this? If so, can you tell me

  • Which version of Web Chat you are using?

  • Which version of NPM you are using?

  • Which version of React you are using?

  • Are you able to provide minimum reproducible code for your Web Chat instance? If not, can you provide more code showing how the ChatBot() function is being used, including any parent components, if relevant?

  • Does the bot respond when input is provided by the user even tho no welcome message is displayed?

  • Have you tried one of the React samples located in this repository to see if the issue persists?

stevkan avatar Jun 28 '24 20:06 stevkan

Closing due to inactivity. Please feel free to reopen if the issue persists or you have new details to share.

stevkan avatar Jul 09 '24 23:07 stevkan