Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public user profile for storing languages and other information #170

Open
ggurdin opened this issue May 7, 2024 · 9 comments
Open

Public user profile for storing languages and other information #170

ggurdin opened this issue May 7, 2024 · 9 comments

Comments

@ggurdin
Copy link
Collaborator

ggurdin commented May 7, 2024

No description provided.

@wcjord
Copy link

wcjord commented May 7, 2024

We want a json of user profile information accessible to everyone in the app.
A user, and only that user, should be able to set and edit their information.

Features to use this

  • Conversation partner
  • Score leaderboard
  • Class analytics maybe if it's saved globally
  • Bot for determining languages
  • In-chat language tools (maybe)
  • Learning settings (for storing languages)

Open questions:

  • Should this be stored as state events or regular events?
    ** state events can only store 90,000
    ** don't want to have to load all the regular events in the timeline to search for a user profile
  • How could an individual's info be retrieved without loading all of these events locally?
  • Are there security considerations? Is there a way to make this more secure?
  • What are the objectives of storing this within Matrix?
    ** Avoid having a separate database.

Resource considerations

  • If we're pushing new events regularly, every user gets updated if they're in the room.

@ggurdin
Copy link
Collaborator Author

ggurdin commented May 7, 2024

Could have user's own language info stored in matrix profile, and only use global store to access others' languages
Check on setting of user profile (on login and on editing) and update the global info if it's different

@ggurdin
Copy link
Collaborator Author

ggurdin commented May 7, 2024

Proposed Solution:

  1. Create a room that everyone in the server can join
  2. Each user on the server will have an event in the room which contains their profile information
  3. To create or update this entry, each time a part of their profile is set or updated:
    1. The user joins the room
    2. The user searches for then event that is tied to their account
    3. If the event does not exist, it will be created
    4. If the event exists, it will be updates with the changes
    5. The user leaves the room
  4. The user's matrix account data will also duplicate this account data, and should be updated each time the global profile is updated. This is to make it more efficient to get the user's language settings, so they do not have to leave and join the room when their language info is read

Open Questions:

  1. When find of event should the profile info be stored in? Should it be a custom event?
  2. Are custom events searchable, or only message events?

@clokep
Copy link

clokep commented May 9, 2024

Create a room that everyone in the server can join

I think this will mean that users will be able to see all other users on the server (i.e. they'll be able to search for all other users). I'm unsure if this is desirable or not.

Each user would also be able to dump a list of all other users on the server, which sounds not desirable.

To create or update this entry, each time a part of their profile is set or updated:

This sounds like you'll be using state events if you're "replacing" them. You would probably want an event type of chat.pangea.profile and state key of the MXID. You'll want to ensure other users can't update each other's state events.

Unfortunately I don't think there's a way to easily limit who can set state events, m.room.member has some special rules to do this, but other events don't.

The user leaves the room

If the user leaves the room I think they won't have access to up-to-date information of other users. It might work if the room is publicly joinable though, which maybe it has to be for anyone to just join. This has ramifications if you ever turn on federation though.


Is the main piece of information that this cares about the user's language or is there additional information that should be kept private?

@ggurdin
Copy link
Collaborator Author

ggurdin commented May 10, 2024

Yes, the main piece of information we want to store right now is the users' languages (and countries), which we want to be available to other users so they can search of others by the languages they know / are learning. We do have information that needs to be kept private, like users' dates of birth, but that data would not be placed in this room.

@clokep
Copy link

clokep commented May 14, 2024

the main piece of information we want to store right now is the users' languages (and countries), which we want to be available to other users so they can search of others by the languages they know / are learning.

Right. I think storing it all in the room has the downsides I mentioned above, but I don't have a much better solution at the moment. There's a couple of things which might work, but I need to investigate first.

@wcjord
Copy link

wcjord commented May 15, 2024

We're going to take out plans for the 'find a conversation partner' feature in favor of a 'find a learning community' feature.

Reasoning:
Users of other language exchanges often complain about harassment, trust, issues, etc. Communities will have admin who can help alleviate this. User of other language exchanges also have issues finding people with whom they can have meaningful conversations. Joining communities and participating in group chats should let people interact more indirectly and find common interests, etc.

Score leaderboards can also be done within spaces.

Architecture proposal based on this design change:

  1. Each user in a space will have an event (type="chat.pangea.profile", state_key=user_id) in that space which contains their profile information.
  2. This event is set or updated at the following times:
  • Each time a part of their profile is set or updated, the event is set for all spaces the user is in
  • When the user joins the space
  • The user leaves the room

The user's matrix account data will also duplicate this account data, and should be updated each time the global profile is updated. This is to make it more efficient to get the user's language settings, so they do not have to leave and join the room when their language info is read. It unfortunately duplicates this information (in their profile and in each room) but this seems to be necessary given other constraints.

The bot can access user languages directly from the database.

With this set of changes, it seems to unnecessary to do a public room for all users.

@clokep Is user_id the same as MXID? If not, what is MXID?

@clokep
Copy link

clokep commented Jun 22, 2024

Each user in a space will have an event (type="chat.pangea.profile", state_key=user_id) in that space which contains their profile information.

If you're going to have a space per language, would being joined to the space be enough "information" that the user is interested in that language?

Is user_id the same as MXID? If not, what is MXID?

Usually I refer to "user_id" as the local part of the "MXID" (e.g. user_id = clokep, MXID == Matrix ID = @clokep:matrix.org). This might not be a universal definition though! They're usually interchangeable.

Someone wrote a new MSC to support custom fields in profiles which could maybe be used for this. It isn't yet supported in Synapse (and would be experimental). You wouldn't be able to search users for these fields though, so probably still wouldn't accomplish what you need.

@tcpipuk
Copy link

tcpipuk commented Jul 5, 2024

It'd be overjoyed if this MSC built on MSC4133 to add extra features like search! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants