When viewing an export that contains a single DM conversation, the sidebar shows the current user's name (e.g. @shehrozahmedd) instead of the other person in the conversation.
Steps to reproduce
- Export a single DM conversation:
slackdump export -o evidence.zip DXXXXXXX
- Open it in the viewer:
slackdump view evidence.zip
- Look at the sidebar under "Direct" -- it shows your own username instead of the other person's name.
Root cause
mostFrequentMember in internal/structures/index.go iterates over a Go map to find who appears most often in DM member lists. When there's only one DM, both members have the same count (1 each). Go map iteration is non-deterministic, so it randomly picks one of them as "me". About half the time it picks the wrong person, causing the User field on the DM channel to be set to the current user instead of the other participant.
Expected behavior
The DM should display the other person's name regardless of how many DMs are in the export.
Version
v4.1.1 (Homebrew)
When viewing an export that contains a single DM conversation, the sidebar shows the current user's name (e.g.
@shehrozahmedd) instead of the other person in the conversation.Steps to reproduce
Root cause
mostFrequentMemberininternal/structures/index.goiterates over a Go map to find who appears most often in DM member lists. When there's only one DM, both members have the same count (1 each). Go map iteration is non-deterministic, so it randomly picks one of them as "me". About half the time it picks the wrong person, causing theUserfield on the DM channel to be set to the current user instead of the other participant.Expected behavior
The DM should display the other person's name regardless of how many DMs are in the export.
Version
v4.1.1 (Homebrew)