Skip to content

API route to look up user by username#2

Open
sussycatgirl wants to merge 3 commits intorevoltchat:masterfrom
sussycatgirl:master
Open

API route to look up user by username#2
sussycatgirl wants to merge 3 commits intorevoltchat:masterfrom
sussycatgirl:master

Conversation

@sussycatgirl
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@arktn arktn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to make bot development simpler! 👍

Comment thread rfcs/rfc-0001-lookup-by-username.md Outdated
Comment thread rfcs/rfc-0001-lookup-by-username.md Outdated
# Drawbacks

- Might require another index in MongoDB
- Since the backend needs to make sure the returned users are mutual, there might be more processing overhead involved, but the logic for this can probably be copied from the /users/:id route

This comment was marked as resolved.

@Zomatree Zomatree added New RFC A New RFC PR New Feature An RFC for a new feature labels Jun 4, 2023
Comment thread rfcs/rfc-0001-lookup-by-username.md Outdated

# Guide-level explanation

Send a `GET` request to `/users/by-name/insert` (no idea how to name the route) to get an array of users matching that username.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a POST to /users/by-name or something along those lines using the body to specify username and later discriminator.

@Zomatree Zomatree added the Draft This RFC is not finished yet label Sep 28, 2023
The `exact` field should default to true and indicates whether we want an exact match (still case insensitive) or if we want to receive all users starting with the search term, similar to Discord's user search - See [below](#prior-art). \
Setting this to `false` will make this endpoint feasable as a replacement for the current temporary [member search route](https://github.com/revoltchat/backend/commit/d81d08f1ce222a9fe05986e15c4e3748bdd5d4ae).

If this is implemented before discriminators are, the `discriminator` field should be supported as a placeholder and functionality can be added at a later point.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If this is implemented before discriminators are, the `discriminator` field should be supported as a placeholder and functionality can be added at a later point.

@erkinalp
Copy link
Copy Markdown
Contributor

erkinalp commented Aug 3, 2024

I strongly oppose this proposal. This is computationally expensive for certain database layouts.

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

Labels

Draft This RFC is not finished yet New Feature An RFC for a new feature New RFC A New RFC PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants