Vendicated / Vencord

The cutest Discord client mod
https://vencord.dev
GNU General Public License v3.0
9.05k stars 1.28k forks source link

[Bug] `UserMessagesPronouns` loading of pronouns #2967

Open Mylloon opened 1 week ago

Mylloon commented 1 week ago

Discord Account

mylloon

What happens when the bug or crash occurs?

The pronouns are only loaded when clicking on the profile

What is the expected behaviour?

I expect pronouns to be loaded without the need of a click

How do you recreate this bug or crash?

  1. Conversation with a user you don't have in the cache
  2. No pronoun
  3. Click on user's profile
  4. Pronouns

Errors

No response

Request Agreement

Vendicated commented 1 week ago

this is kinda difficult to do because pronouns are only available in the profile payload, which you can only fetch by opening someones profile

you have to fetch it individually for every user and the rate limit isn't very generous

thus, fetching everyone in chat is likely not viable

Sqaaakoi commented 1 week ago

I've already dumped some thoughts about this days ago

I've just been trying this out today and I've found a few things that feel weird about the plugin I wouldn't be surprised if these existed in the PronounDB plugin too

  1. The tooltip showing "Pronouns" feels off-center, because it includes the
  2. Pronouns are not cached by the plugin itself, so every time the client is restarted, pronouns do not show until the user profile is opened, defeating the point of the plugin

1 is trivial to solve, the second isn't so much. How do you propose solving that? Cache in DataStore every time it's rendered, if Discord can't provide pronouns then load from cache?

the only realistic way of solving this (excluding spamming the API) is making a cache in DataStore, which isn't hard to do

i'd suggest having each user in the cache expire after not being used for amount of time