SleeplessOne1917 / lemmy-bot

A bot library for Lemmy, the fediverse link aggregator.
https://www.npmjs.com/package/lemmy-bot
GNU Affero General Public License v3.0
93 stars 11 forks source link

Getting `user_already_exists` error after login #34

Closed fthues closed 1 year ago

fthues commented 1 year ago

Every login attempt results in a user_already_exists error. This probably happens in saveUserSettings() and looks like it's related to this issue, apparently one needs to include all user data in saveUserSettings().

SleeplessOne1917 commented 1 year ago

I'll make a fix, although it might make more sense to update the lemmy endpoint than the bot.

fthues commented 1 year ago

Agreed!

How about adding a (temporary?) config option that when enabled would just skip the whole marking as a bot step, avoiding saveUserSettings altogether?

sylverstream commented 1 year ago

IMO it would be better if it would check if it was already marked as bot, and thus only call saveUserSettings when it's not marked as a bot yet? Saves a config setting :)

Pdzly commented 1 year ago

Agreed!

How about adding a (temporary?) config option that when enabled would just skip the whole marking as a bot step, avoiding saveUserSettings altogether?

I am 100% for that as this is somewhat a possible ratelimit that could trip on too many times called ( for example script restarted )

SleeplessOne1917 commented 1 year ago

I'll go with the config option. I would use @sylverstream's option if the login response included that information, but as it does not it would just add yet another request.

SleeplessOne1917 commented 1 year ago

Added the config option in v0.4.3. Closing this issue.