Skip to content

fix: skip Redis auth when credentials are unset with unit test (#541)#545

Open
Justxd22 wants to merge 3 commits intocameri:mainfrom
Justxd22:fix/541-redis-auth-unset-credentials
Open

fix: skip Redis auth when credentials are unset with unit test (#541)#545
Justxd22 wants to merge 3 commits intocameri:mainfrom
Justxd22:fix/541-redis-auth-unset-credentials

Conversation

@Justxd22
Copy link
Copy Markdown
Collaborator

Description

  • fix Redis cache config to skip AUTH when REDIS_PASSWORD is unset
  • use redis://host:port when no credentials are provided
  • keep REDIS_URI precedence when present
  • add unit test coverage in test/unit/cache/client.spec.ts for:
    • no REDIS_URI + no password
    • password-based config
    • REDIS_URI precedence

Related Issue

#541

How Has This Been Tested?

npm run test:unit

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

Copilot AI review requested due to automatic review settings April 19, 2026 22:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Redis cache client configuration so the app does not attempt Redis AUTH when REDIS_PASSWORD is unset (and still respects REDIS_URI when provided), and adds unit tests plus a changeset to cover the expected configuration behavior.

Changes:

  • Update getCacheConfig() to build an unauthenticated Redis URL when credentials are not provided, while keeping REDIS_URI precedence.
  • Add unit tests covering unauthenticated config, authenticated config, and REDIS_URI precedence.
  • Add a patch changeset documenting the fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/cache/client.ts Adjusts Redis client options generation to avoid AUTH when password is unset.
test/unit/cache/client.spec.ts Adds unit coverage for the updated Redis cache config behavior.
.changeset/thirty-turtles-design.md Declares a patch release for the Redis config fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/unit/cache/client.spec.ts Outdated
Comment thread src/cache/client.ts
Comment thread src/cache/client.ts
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 19, 2026

Coverage Status

coverage: 73.72% (-0.02%) from 73.738% — Justxd22:fix/541-redis-auth-unset-credentials into cameri:main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants