Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/queue/src/Queue/Connection/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ protected function getRedis(): \Redis
try {
$redis->connect($this->host, $this->port, $connectTimeout);

if ($this->password !== null && $this->password !== '') {
// ACL form when a username is configured, plain password otherwise.
$hasUser = $this->user !== null && $this->user !== '';
$redis->auth($hasUser ? [$this->user, $this->password] : $this->password);
}
Comment on lines +205 to +209

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Authentication Paths Lack Coverage

This authentication path has no observable behavioral coverage. The existing Redis test service has authentication disabled, so the suite cannot detect regressions in either password-only authentication or the new ACL username/password form. Add integration tests against an authenticated Redis instance that verify successful publish or consume behavior with each credential form and rejection of invalid credentials. Include the "0" credential case highlighted by this change rather than asserting the exact auth() arguments.

Knowledge Base Used: Messaging, queues, and NATS

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/queue/src/Queue/Connection/Redis.php
Line: 205-209

Comment:
**Authentication Paths Lack Coverage**

This authentication path has no observable behavioral coverage. The existing Redis test service has authentication disabled, so the suite cannot detect regressions in either password-only authentication or the new ACL username/password form. Add integration tests against an authenticated Redis instance that verify successful publish or consume behavior with each credential form and rejection of invalid credentials. Include the `"0"` credential case highlighted by this change rather than asserting the exact `auth()` arguments.

**Knowledge Base Used:** [Messaging, queues, and NATS](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/utopia-php/monorepo/-/docs/messaging-queue-nats.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex


if ($this->readTimeout >= 0) {
$redis->setOption(\Redis::OPT_READ_TIMEOUT, $this->readTimeout);
}
Expand Down