Skip to content

Viewer shows current user's name instead of the other person for DMs #654

@shehrozsheikh

Description

@shehrozsheikh

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

  1. Export a single DM conversation:
    slackdump export -o evidence.zip DXXXXXXX
    
  2. Open it in the viewer:
    slackdump view evidence.zip
    
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions