🎁 Suggested improvements: BullMQ n8n queue, media security, graceful shutdown#1
Open
kobie3717 wants to merge 1 commit intoNaude555:mainfrom
Open
🎁 Suggested improvements: BullMQ n8n queue, media security, graceful shutdown#1kobie3717 wants to merge 1 commit intoNaude555:mainfrom
kobie3717 wants to merge 1 commit intoNaude555:mainfrom
Conversation
… notes - Replace in-memory n8n forward queue with BullMQ (crash-safe, retries) - Fix media endpoint: remove express.static bypass, all media goes through signature verification - Enhance graceful shutdown: drain queues, close Baileys socket, stop HTTP server - Add TODO comments suggesting SQLite migration path for message store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey! 👋 Love what you've built with Watson — clean and practical.
I was poking around and noticed a few small things that might help as the project grows. Wanted to contribute back rather than just fork, so here are 4 suggestions in one clean commit:
1. 🔄 n8n forward queue → BullMQ (crash-safe)
The in-memory
n8nQueue = []works great, but if the process restarts mid-forward you lose queued events. This swaps it for a BullMQ queue (you already have the pattern for the outbound send queue) so n8n forwards survive restarts and get proper exponential backoff retries.2. 🔒 Media endpoint security fix
The
express.staticmiddleware on/mediawas serving files before the signature verification route could run. Removed the static middleware so all media requests go through your existing signed URL check — no more bypassing the signature.3. 🛑 Enhanced graceful shutdown
Extended your existing shutdown handler to also:
4. 📝 SQLite migration breadcrumbs (comments only)
Added TODO comments at
readMessagesStore/writeMessagesStoresuggesting a future SQLite migration path. No code changes — just notes for when the JSON store starts feeling heavy.All changes are in
server.js, matching your existing style. Take what's useful, ignore what's not! 🙂