Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[MM-14278] Display same recent emoji only once #2423

Merged
merged 1 commit into from
Mar 1, 2019

Conversation

bradjcoughlin
Copy link
Contributor

@bradjcoughlin bradjcoughlin commented Feb 27, 2019

Summary

  • A recent change had recent emojis stored by alias, resulting in identical emoji such as :thumbsup: or :+1: to be displayed twice
  • This reverts that change to store by the first alias only, de-duplicating the recent history
  • Additionally, emoji.id was undefined, using emojiIndex instead. No real impact with the above fix applied, but this prevents the indices from showing 1f609:undefined for example.

Ticket Link

https://mattermost.atlassian.net/browse/MM-14278

Checklist

  • Ran make check-style to check for style errors (required for all pull requests)
  • Ran make test to ensure unit and component tests passed
  • Has UI changes

* A recent change had recent emojis stored by alias, resulting in identical emoji such as 👍 or 👍 displayed twice
* This reverts that change to store by the first alias only, de-duplicating the recent history
* Additinally, `emoji.id` was undefined, using `emojiIndex` instead
@lieut-data
Copy link
Member

Thanks for digging into this, @bradjcoughlin! Looks like this line was changed as part of #2224. Can you comment on whether the functionality of that PR is maintained with your changes?

@hmhealey hmhealey added the 2: Dev Review Requires review by a core commiter label Mar 1, 2019
@bradjcoughlin
Copy link
Contributor Author

bradjcoughlin commented Mar 1, 2019

@lieut-data from my testing, it appears that the following logic/functionality still works as expected from #2224:

  • First, display recently used emoji that match the search term, in alphabetical order
  • Second, display emoji that start with the search term, in alphabetical order
  • Last, display emoji that contain the search term, in alphabetical order.

Copy link
Member

@lieut-data lieut-data left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Are there unit tests we can update here?

@bradjcoughlin bradjcoughlin added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Mar 1, 2019
@bradjcoughlin bradjcoughlin merged commit 0de0500 into mattermost:master Mar 1, 2019
@bradjcoughlin bradjcoughlin removed the 4: Reviews Complete All reviewers have approved the pull request label Mar 1, 2019
@bradjcoughlin
Copy link
Contributor Author

bradjcoughlin commented Mar 1, 2019

@lieut-data I believe so. Specifically related to this PR, I could add a test verifying the first alias is returned in recent emojis even if an alternative alias was used.

This tests seems to be checking only the primary alias.

it('addRecentEmoji', async () => {
store.dispatch(Actions.addRecentEmoji('grinning'));
assert.ok(getRecentEmojis(store.getState()).includes('grinning'));
store.dispatch(Actions.addRecentEmoji('joramwilander'));
assert.ok(!getRecentEmojis(store.getState()).includes('joramwilander'));
});

@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Mar 19, 2019
stevepartridge pushed a commit to stevepartridge/mattermost-webapp that referenced this pull request Mar 30, 2019
* A recent change had recent emojis stored by alias, resulting in identical emoji such as 👍 or 👍 displayed twice
* This reverts that change to store by the first alias only, de-duplicating the recent history
* Additinally, `emoji.id` was undefined, using `emojiIndex` instead
@lindy65 lindy65 added the Tests/Not Needed Does not require new release tests label Apr 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Not Needed Does not require new release tests
Projects
None yet
5 participants