Skip to content

Use LocalStorage for frequently used emoji

What does this MR do and why?

Previously, a cookie was used for this but (a) there is no need to use a cookie for communicating with the backend here, all the logic is in the frontend and (b) cookies expire. Prior to this MR, a user's frequently used emojis list would periodically get cleared out. This change will mean that a user's frequently used emoji list persists until such time as the user manually clears their local storage.

CAVEAT: prior to this MR and with the changes in this MR, a user's frequently used emoji list is specific to one browser. If the user logs in on another device or uses a different browser on their main device, then they will not be able to access the same frequently used emojis list. An ideal future improvement would include syncing this list to the server at regular intervals.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

there are no UI changes for this MR

How to set up and validate locally

  1. Open the GDK before checking out this branch.
  2. Apply some emoji reactions and take note of your frequently used emojis.
  3. Open the dev tools and check your cookies for the GDK
    1. You should see that the cookie frequently_used_emojis exists and it contains a comma separated list of emoji names.
    2. In the Application section of dev tools, check local storage for a key named frequently_used_emojis. You should see that it does not exist.
  4. Check out this branch locally
  5. Visit an issue
  6. Click the "add reaction" emoji button on the issue
  7. You will see that you have a "frequently used" section in the emoji picker and it contains your frequently used emojis.
  8. Open the dev tools and check your cookies for the GDK
    1. You should see that the cookie frequently_used_emojis does not exist anymore
    2. In the Application section of dev tools, check local storage for a key named frequently_used_emojis. You should see that it now exists, and contains a comma-separated list of emoji names.
Edited by Chad Lavimoniere

Merge request reports