String telnet config (e.g. quoted '1500' in /etc/prosody-muc-rest.js or
string env-var overrides) reached net.Socket.setTimeout via telnet-client
and crashed the pool on connect with ERR_INVALID_ARG_TYPE. Coerce port,
timeout, and poolSize to numbers with fallbacks before use.
Part-of: <http://gitlab.vnc.biz/uxf/prosody-muc-rest/-/merge_requests/3>
Phase 4 verification harness in loadtest/:
- bench-pool.js: standalone dep-free model showing pool of 4 = 4x and
pool of 8 = 8x throughput vs a single serialized connection.
- run.js: autocannon harness for the read path (req/s + p50/p90/p99).
- docker-compose.loadtest.yml + init.sql: seeded Postgres + app read-path
stack (no Prosody) for local load testing.
- README.md: usage and staging validation checklist.
Part-of: <http://gitlab.vnc.biz/uxf/prosody-muc-rest/-/merge_requests/3>
Addresses PERFORMANCE-FINDINGS #5:
- setMucData now returns a Promise that rejects on DB error, missing
config row, or HTTP failure instead of swallowing return true/false.
- Add rowCount guard to avoid throwing on missing config row.
- PUT /groupchats/:target awaits setMucData and returns 500 on failure.
- Remove dead call to undefined logging() function.
Part-of: <http://gitlab.vnc.biz/uxf/prosody-muc-rest/-/merge_requests/3>
Addresses PERFORMANCE-FINDINGS #3, #7, #8:
- Parameterize GET /groupchats query with $n placeholders and parseInt
validation to close SQL injection and restore pg prepared-statement cache.
- Fix xmlEscape: use real regexes (& first) instead of no-op string patterns.
- Replace deprecated new Buffer() with Buffer.from() for Basic auth header.
Part-of: <http://gitlab.vnc.biz/uxf/prosody-muc-rest/-/merge_requests/3>
Addresses PERFORMANCE-FINDINGS #1, #4, #6 (and #2 in creategroup flow):
- Add app/telnet-pool.js: pool of N connections (config.telnet.poolSize,
default 4) with wait-queue, lazy reconnect, and respawn on dead socket.
- Remove module-level new Telnet() singleton and startup socket dump from
app/routes/index.js; switch all mutating endpoints to telnetPool.send().
- Set telnet debug:false; use config.telnet.timeout (default 5s) instead
of hardcoded 30000.
- Add telnet.poolSize to config/prosody-muc-rest.js.
- await doesMucExist in /creategroup so the existence check is no longer dead.
Part-of: <http://gitlab.vnc.biz/uxf/prosody-muc-rest/-/merge_requests/3>