Repository navigation
fix: handle empty password, missing port, and TLS in Redis URL parsing - #2021
Merged
Merged
Conversation
- password: coerce empty string to undefined (suppresses ioredis warning)
- port: default to 6379 when omitted (prevents NaN from parseInt(''))
- tls: extract protocol and return tls: {} for rediss:// URLs
Pass tls config from parseRedisUrl to redis-config service, BullMQ queue, and collaboration gateway so rediss:// URLs actually enable TLS.
Yundi339
added a commit
to Yundi339/docmost
that referenced
this pull request
Apr 22, 2026
- parseRedisUrl now decodeURIComponent-s the password so URLs with
percent-encoded specials (e.g. '%40' for '@') connect correctly.
- Missing port falls back to 6379 instead of NaN.
- rediss:// URLs now set tls: {} which is threaded through to the four
ioredis consumers (collab, queue, nestjs-ioredis, throttler).
Cherry-picked from upstream docmost#1952 and docmost#2021.
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.
Fixes three edge cases in
parseRedisUrl()that cause issues with common Redis URL formats:1. Empty password triggers ioredis warning
new URL('redis://localhost:6379').passwordreturns""(empty string). ioredis treats any string — including empty — as a supplied password, spamming logs with:Fix:
password: password || undefined2. Missing port produces
NaNnew URL('redis://localhost/0').portreturns""when omitted.parseInt('', 10)isNaN, which breaks the connection.Fix:
port ? parseInt(port, 10) : 63793.
rediss://TLS silently droppedFor
rediss://URLs, the protocol indicates TLS should be used, but the parsed config object never included atlsfield. Any code using the parsed config (instead of the raw URL string) silently drops TLS.Fix: Extract
protocolfrom the URL and returntls: {}forrediss://schemes. Propagated to all Redis consumers (redis-config service, BullMQ queue module, collaboration gateway).