The current code caches the user list on startup and builds a mapping of nickname to usernames. This should not be necessary with the new account system, it's possible to get a user from and IRC nickname with the API call to:
https://fasjson.fedoraproject.org/v1/search/users/?ircnick=nickname
Getting users should also be simple, just a matter of calling https://fasjson.fedoraproject.org/v1/users/username/ and making sure it's not a 404.
The cache causes the following problems:
long startup, as all usernames are retrieved from FASJSON
outdated user values: if a user switches from private to non-private, their nickname should become visible, but the bot does not refresh the cache and as a result the user still can't give cookies (for example).
The current code caches the user list on startup and builds a mapping of nickname to usernames. This should not be necessary with the new account system, it's possible to get a user from and IRC nickname with the API call to:
https://fasjson.fedoraproject.org/v1/search/users/?ircnick=nickname
Getting users should also be simple, just a matter of calling
https://fasjson.fedoraproject.org/v1/users/username/
and making sure it's not a 404.The cache causes the following problems: