Skip to content

refactor(redis): simplify RedisFactory connection setup and error handling - #61976

Open
joshtrichards wants to merge 1 commit into
masterfrom
jtr/refactor-RedisFactory-setup
Open

refactor(redis): simplify RedisFactory connection setup and error handling#61976
joshtrichards wants to merge 1 commit into
masterfrom
jtr/refactor-RedisFactory-setup

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

Refactor RedisFactory to make connection setup easier to follow and version/configuration errors more actionable.

Changes:

  • extract standalone connection setup into a helper
  • extract auth argument building into a helper
  • centralize Redis/cluster config resolution
  • cache Redis capability/version checks
  • improve Redis-related exception messages by including detected php-redis version state
  • throw \UnexpectedValueException instead of generic \Exception when cluster seeds is missing
  • clean up related comments and docblocks
  • simplify guard clauses, reduce legacy nesting, enable strict_types

Notes:

  • no intended functional change beyond throwing \UnexpectedValueException when the seeds attribute is missing
  • cluster configuration still takes precedence over standalone Redis configuration
  • ssl_context handling remains unchanged; unsupported versions now produce more informative exception messages

TODO

  • Confirm tests pass as-is
  • Outside scope of PR itself, but determine if redis.persistent is intentionally (or merely inadvertently) undocumented

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added enhancement 2. developing Work in progress technical debt 🧱 🤔🚀 feature: caching Related to our caching system: scssCacher, jsCombiner... ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 10, 2026
@joshtrichards joshtrichards added this to the Nextcloud 35 milestone Jul 10, 2026
@joshtrichards
joshtrichards marked this pull request as ready for review July 10, 2026 15:17
@joshtrichards
joshtrichards requested a review from a team as a code owner July 10, 2026 15:17
@joshtrichards
joshtrichards requested review from come-nc, icewind1991, provokateurin and salmart-dev and removed request for a team July 10, 2026 15:17
@susnux susnux added the community pull requests from community label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews community pull requests from community enhancement feature: caching Related to our caching system: scssCacher, jsCombiner... ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants