redlib-org / redlib

Private front-end for Reddit
GNU Affero General Public License v3.0
1.38k stars 96 forks source link

fix: refresh oauth token by spawning a new task #241

Closed pimlie closed 2 months ago

pimlie commented 2 months ago

This should fix the behaviour as described in this comment: https://github.com/redlib-org/redlib/issues/229#issuecomment-2354114934

Now if you refresh the page, the token should really be renewed

pimlie commented 2 months ago

The failing tests are the same ones as on the main branch.

perennialtech commented 2 months ago

Looks good, applying this patch reduced the amount of https://github.com/redlib-org/redlib/issues/237 rate limiting errors on my instance, though they still occur occasionally.

pimlie commented 2 months ago

Yeah, I don't think this PR fixes it actually, gonna close it.

The token WAS already refreshed, its just that the first 32 chars that are logged to the console are basically always the same. So looking at those logs it seemed the token did not refresh, but it did.

Also still have intermittent issues where I keep getting rate limited

perennialtech commented 2 months ago

Perhaps just keep this PR open in the meantime while a better solution is being worked on?

For whatever reason, the patch at least somewhat brings an instance back to life, versus it being completely unusable.

pimlie commented 2 months ago

I tested also with the original fix and Im actually not seeing any difference in behaviour between the original fix and the fix in this PR anymore.

Seems the responses from Reddit just made it look for a while this was a fix. That said, it's still weird that restarting redlib seems to fix the issue. Not sure what's different after a restart, trying to figure that out now.

sigaloid commented 2 months ago

Seems the responses from Reddit just made it look for a while this was a fix

Yes, their responses are often extremely confusing. Wouldn't be surprised if it was intentional to trip spoofing users up. :disappointed: