Skip to content
This repository was archived by the owner on Apr 3, 2026. It is now read-only.
This repository was archived by the owner on Apr 3, 2026. It is now read-only.

American Red Cross user group has a user in the member list with no profile name #687

Open

Description

@udaynwa

there are users that show up in user groups without names.
Screen Shot 2023-04-17 at 9 19 43 AM

Activity

  1. added
    bug
    on Jan 27, 2023
  2. danbjoseph commented on Apr 17, 2023

    @danbjoseph
    Member

    @Hagellach37:
    this is a user who signed up with an OpenStreetMap account. for these users we get the username from OSM. but maybe we need to check how we store the OSM username.

    @thenav56:
    I poked around and looks like for the osm user have this attribute displayName in the firebase which the python-worker doesn't store or use. Quick fix will be to use the user_id if username is empty or not provided. And decide is we can use displayName for username and sync all existing users as well. For now, should we go for the quick fix?

    @Hagellach37:
    probable we don't set it properly for the users that log in with their osm account
    basically we need to set it twice:
    firebase authentication --> displayName
    firebase realtime database --> username
    can you confirm this @laurentS?

    @laurentS:
    yes, correct, firebase uses 2 different names as Benni mentioned above. When a users signs up with email/password, we copy their chosen username to both places (auth.displayName and db.username) but it looks like for OSM logins (it is difficult to know if the user had signed in with OSM before or not), we copy their displayName but maybe not their username https://github.com/mapswipe/python-mapswipe-workers/blob/master/firebase/functions/src/osm_auth.ts#L230

    @laurentS:
    you'd have to confirm this, but I suspect you may not have access to displayName if not authenticated as the user. If so, I'll have to figure out where to copy it to username so that you have access to it. It seems like an auth issue more than a problem with your stats

    @danbjoseph:
    this is on the open, community dashboard pages so the viewer will never be authenticated

    @laurentS:
    ok, I've added this to my todo list :)

    @Hagellach37:
    another insight about this. For users with OSM login we set the name as displayName in firebase database, but for users that sign up via email we set the name as username.
    E.g. see here the differences:

     {
      "created": "2023-01-24T12:25:48.677Z",
      "displayName": "nassanga",
      "groupContributionCount": 28,
      "lastAppUse": "2023-02-02T17:24:28.142Z",
      "projectContributionCount": 5,
      "taskContributionCount": 1465
    }
    
    {
      "created": "2020-10-15T19:12:27.532Z",
      "groupContributionCount": 2,
      "lastAppUse": "2022-01-07T16:11:15.568Z",
      "projectContributionCount": 2,
      "taskContributionCount": 322,
      "teamId": "-MekUI0PHI2M1AGavW0j",
      "username": "Benni Bamako"
    }
    

    I think this is what @thenav56 also said, but I didn't get it right in the first place. Good catch

  3. kopitek8 commented on Oct 22, 2024

    @kopitek8
    Contributor

    @danbjoseph

    Issue

    https://community.mapswipe.org/user-group/-O7hKfEs6CcnzHVZ_V9b/

    Findings

    The OSM usernames are currently not displayed in the dashboard because python-mapswipe-workers stores OSM usernames only in Firebase and not in the database. Although it is possible to store and save these usernames in the database, this approach will contradict with #678.

    Quick Fix

    1. We will show the osm id instead of User column for now with a hyperlink that redirects to the user profile.
    2. We will show the osm id in the profile page if username is empty
  4. Katbaloo commented on Oct 28, 2024

    @Katbaloo

    @kopitek8 any update on this? Still not clear if this is solely an OSM name issue, but given reports from our users, suspect not? Thanks!

  5. kopitek8 commented on Oct 29, 2024

    @kopitek8
    Contributor

    Hey @Katbaloo. We are working on the fix and should be complete soon. It is an OSM name issue because OSM usernames are not stored in the database while MapSwipe account usernames are. We'll share more if we find any inconsistencies.

  6. kopitek8 commented on Oct 29, 2024

    @kopitek8
    Contributor

    Solution

    We have updated the logic to display the usernames in the User Group table and export. Now if a user's username is empty, then the user's ID will be shown. Screenshot of a test OSM user attached below. If more details are required, clicking on the ID will redirect to the user's profile.

    User Group Members Table

    Image

    Profile Page

    Image

  7. danbjoseph commented on Oct 30, 2024

    @danbjoseph
    Member

    do we have the actual osm username? instead of osm:* with the user id number?
    for example if i create an account with my osm account i would want it to show danbjoseph and not osm:1535212 in the stats boards. in the app it does show my danbjoseph name after authorizing with OSM.

  8. kopitek8 commented on Nov 5, 2024

    @kopitek8
    Contributor

    @danbjoseph

    For the community dashboard, the actual OSM usernames are not stored in the postgres database. Maybe we can add it in future iteration of the python-mapswipe-workers. For the time being, instead of showing empty cells, we decided to at least show usernames.

    Whereas, the app pulls data from Firebase where the username is stored.

    All in all, we should definitely streamline the stats and data across platforms to make it consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions