tagreplacer icon indicating copy to clipboard operation
tagreplacer copied to clipboard

Move find and replace into task queue, send progress updates via websockets

Open cubeghost opened this issue 3 years ago • 1 comments

Problems this hopes to solve:

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 TumblrClient and into workers, allowing for more exact rate limiting
  • Probably use the client-persisted results of find to queue the replace jobs, instead of running find again 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

EqlPkQjWMAErPh7

cubeghost avatar Dec 30 '21 04:12 cubeghost

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"

cubeghost avatar Feb 20 '24 06:02 cubeghost