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

No welcome message in react despite userID set #5173

Open
benferns opened this issue May 7, 2024 · 0 comments
Open

No welcome message in react despite userID set #5173

benferns opened this issue May 7, 2024 · 0 comments
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-reported Required for internal Azure reporting. Do not delete.

Comments

@benferns
Copy link

benferns commented May 7, 2024

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 benferns added Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-reported Required for internal Azure reporting. Do not delete. labels May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. bug Indicates an unexpected problem or an unintended behavior. customer-reported Required for internal Azure reporting. Do not delete.
Projects
None yet
Development

No branches or pull requests

1 participant