-
Notifications
You must be signed in to change notification settings - Fork 2.7k
MM-15228 consecutive bot posts maintain the profile image #2716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @scottleedavis!
After testing with the reminder bot, looks like consecutive posts aren't maintaining the profile image (and username). This is using v0.1.6 of the plugin
@jasonblais I had neglected 'compact view'. With Standard view I believe they are not grouped. |
Though yours look different than collapsed. The spinmint server gives me different results currently that what you got. |
@scottleedavis That's odd. Mine is indeed in Standard View. Reproduces on macOS Sierra, latest Chrome version |
After a couple page refreshes (chrome, osx mojave) I was able to reproduce it in the spinmint server. I am however, not currently able to reproduce the issue locally e38ac5b. |
@hmhealey @saturninoabril This PR works locally (for me) but not on this spinmint. Do you have a recommendation on how best to troubleshoot this? |
Thanks @scottleedavis, I'm checking... |
Hm, I'm not able to reproduce it on this new spinmint. So I'll approve the PR with the latest changes. |
@saturninoabril @scottleedavis Actually, it does reproduce.
Observed: Consecutive posts do not have profile picture or username of the bot |
@saturninoabril @jasonblais I also confirm that using the same branch locally, works as intended. |
@jasonblais @saturninoabril I was able to replicate the failure locally by recloning the repo and starting fresh. This latest commit fixes the issue for me locally, and I am hoping it will run in spinmint as well. :) |
Thanks @scottleedavis!! Looks like the build is failing, can you help take a look? I'll then generate a new spinmint to test |
Thanks @scottleedavis! Consecutive posts now indeed maintain profile picture and username. However, on page reload while the profile loads, the posts are initially collapsed, until they're separated. This is different from the behaviour for webhook posts, and may cause scroll pop when loading a channel: I'm wondering if there is a way to maintain user profile for consecutive bot posts similar to consecutive webhook posts while the channel contents load? |
@jasonblais My attempts at optimizing the rendering of user profile for bot posts has not been fruitful so far, and I am curious how to best solve it. |
@jasonblais following your idea to render the same as a webhook bot, I followed the same pattern of using the post.props sent from server, one called 'from_bot'. In doing so, the 'scroll pop' effect has gone away. This is because the webapp no longer needs a second call to the store to pull a user object to determine 'isBot' . This required a minimal server side change as well. mattermost/mattermost#10793 Please let me know if this solves the problem! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks @scottleedavis! Scroll pop is now resolved based on testing I carried out.
One more question which is not directly related to this PR and hence not blocking - would you know why the bot post username and profile picture aren't initially loaded after a page refresh, whereas they are for regular users (and also for webhook posts, as in above screenshot).
@jasonblais Looking at For bots, a userId is passed, which at first pass is not found in the store and For user & webhook username 'Someone' is displayed for one render cycle before switching to the correct username. For bots it is two, which produces the noticeable shift. I noticed posts stop collapsing for normal users at commit 32d5332 (@hmhealey) after I merged in master. Is that to be addressed in a separate PR? |
Thanks @scottleedavis! Appreciate it I've created two tickets: one for not loading username and profile picture immediately after page refresh, and included your investigation as part of the ticket: https://mattermost.atlassian.net/browse/MM-15433 Bug ticket for regular user posts no longer collapsing: https://mattermost.atlassian.net/browse/MM-15432 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @scottleedavis!
Summary
This adds the profile image in consecutive bot posts.
Ticket Link
Fixes mattermost/mattermost#10681
Related Pull Requests