question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Avatars and Decorating with activityMiddleware do not play well together

See original GitHub issue

I am struggling with this for some time now (see also this SO question). I reproduced the issue using the samples so hopefully you guys can shed some light on this.

The problem: Avatars are not shown as soon as you use activity middleware for decorating.

To reproduce:

step 1. Clone the sample with the password input. step 2 Add this code to the index.html

     const styleOptions = {
          botAvatarInitials: 'WC',
        };

and pass styleOptions={styleOptions} in ReactWebChat

                window.ReactDOM.render(
          <ReactWebChat
            activityMiddleware={activityMiddleware}
            directLine={window.WebChat.createDirectLine({ token })}
            store={store}
            styleOptions={styleOptions}
          />,
          document.getElementById('webchat')
        );

Step 3. Send ‘sample:password-input’ to the the mock bot. The password input form is shown but no avatar Step 4. Send ‘Hi’ to mock-bot. The avatar is shown with the response.

For some reason, avatars are not shown when I decorate based on an evetn sent by the bot-code. This used to work before 4.14. Should I use a workaround?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
HesselWellemacommented, Mar 17, 2022

Nope. Wanted you give you the honour to close it.

1reaction
stevkancommented, Feb 15, 2022

@HesselWellema, thanks for bringing this to our attention. I will attempt a repro of this and let you know what I find.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webchat: unable to render new elements using ...
With activitymiddleware and showAvatarInGroup : 'group' -> typing indicators are rendered as expected and the Avatar as well as the ...
Read more >
Avatar Middleware does not register new activity until switch in ...
When utilizing avatar middleware, the hook seems to store the first activity when change in "fromUser" and does not register new activity ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found