nitter
nitter copied to clipboard
User id change redirection may make it impossible to access users
If user A change id from @a to @aa, nitter.net/a will redirect to nitter.net/aa. But if another person takes user id @a, it will still redirect to @aa, making it impossible to access (the new) @a
example: @whitehouse @whitehouse45
Sometimes, the problem is solved by whatever mechanism. For examples: the @PLOTUS and @VP, after redirecting to archived tweets of the previous users, does no more redirects ans belong now to their respective actual users. Though, the accounts @whitehouse and @FLOTUS still have the problem.
I know exactly why this issue happens, the problem is just finding a reasonable solution. Nitter stores lookup tables in Redis that map usernames to user IDs. This is done because the timeline request requires the ID, and getting the ID from the username otherwise requires fetching the profile first (this is how twitter's own web client does it). If the lookup tables are removed, it would take at least twice as long to visit a timeline, since one extra API request is needed per visit.
So, once you visit an account once, that username is tied to the ID in the database, until it's purged. Simply setting a TTL doesn't work for various reasons, but thanks to Redis being incredibly fast and efficient I may be able to do a simpler solution that's less efficient than the bucketed hashtables currently used.
I'll be doing some experiments this week to find a decent solution with a reasonable memory footprint. For now I've purged nitter.net's lookup tables to fix @stemy2's issues, I encourage other instance admins to do the same by running the following:
redis-cli -h localhost -p 6379 --scan --pattern "pid:*" | xargs redis-cli -h localhost -p 6379 unlink
My twitter-rss proxy has just been broken (thanks twitter) so I've been looking into how nitter is dealing with username changes. I dealt it in mine by including user id in the url itself so it doesn't matter if the name changes (https://mytwitterproxy.example.com/123123123/someuser).