tagreplacer
tagreplacer copied to clipboard
Move find and replace into task queue, send progress updates via websockets
Problems this hopes to solve:
- Requests for tags with a lot of posts sometimes just time out
- We need to be able to rate limit all Tumblr API calls
The idea:
- Use a task queue for find and replace operations (trying BullMQ)
- Emit data events every time we get a page of results and send those back to the client using websockets
- Move pagination loop out of
TumblrClientand into workers, allowing for more exact rate limiting - Probably use the client-persisted results of
findto queue thereplacejobs, instead of runningfindagain like we do now
Early draft of system diagram
it's close enough
Stuff that ended up happening too:
- Getting rid of class components and HOCs (it's ~2022~ ~2023~ 2024)
- I want to try using Redux Toolkit so that's in the mix
- Developed a mental block around the state design and tried designing a new frontend to get out of it
- Still had a mental block so I forgot about this for like a year

one big issue currently is the websocket message queue is keyed to the user session, if a user has multiple tabs of the tag replacer open, the websocket messages end up splitting between them kind of randomly(?). we need to either share the entire app state between tabs (a la service workers) or have unique message queues per "tab session"