colorstackorg / oyster

Monorepo that houses ColorStack's core product software.
MIT License
281 stars 139 forks source link

slack message preview on the points page #493

Open gpolite0 opened 2 months ago

gpolite0 commented 2 months ago

Description

On the points page, if there is a slack message with a user @ or a slack channel name, the preview will show some letters and numbers, not the correct user @ and channel name.

Steps to Reproduce

  1. React to a slack message that contains a user name and/or a slack channel name (e.g. this message)
  2. Go to your points page on the ColorStack profile
  3. Notice how in Activity History, the preview does not properly display the user @ or the channel name

Expected Behavior

The actual user @ and the channel name

Screenshots

Screenshot 2024-08-31 at 12 33 36 AM Screenshot 2024-08-31 at 12 33 19 AM
ayoaru commented 2 months ago

I'd be happy to take this one on 🫡

tomas-salgado commented 2 months ago

@ayoaru since this issue is a bug and there's no clear written solution to fix it yet, would you be able to first write up a plan of attack? I'll add that this bug is trickier than it initially seems, so feel free to look into it more and then lmk if you still want it!

ayoaru commented 2 months ago

@tomas-salgado I'm about to go in and take a look, do you have any details? My initial thoughts are that it has something to do with the message on Slack retrieving user ID's internally, but the API may not have access to that information outside of the Slack application. Will update momentarily after poking around.

ayoaru commented 2 months ago

Ah, I see it's pasting the links to each member's profile (from one of the members mentioned, it snagged the tag at the end U05LNFR22LS and that's what got pasted as opposed to the person's name). Looking at the page routing for the points page I believe the function below is what needs to be modified and/or something within the gamification module.

const completedActivities = _completedActivities.map((activity) => {
    if (activity.messageReactedToText) {
      activity.messageReactedToText = emojify(activity.messageReactedToText);
    }

    if (activity.threadRepliedToText) {
      activity.threadRepliedToText = emojify(activity.threadRepliedToText);
    }

    return activity;
  });
tomas-salgado commented 1 month ago

@ayoaru sorry for the delay here! I'll assign this to you assuming you still want to go further into it-let me know if otherwise

ayoaru commented 1 month ago

Sounds good! I'm on it

ayoaru commented 1 month ago

Update: Will be working on this with Bloomberg mentor/completing this during mentorship

Boris713 commented 2 days ago

@ayoaru still working on this?

ayoaru commented 2 days ago

@Boris713 yea just haven't pushed changes yet