Skip to content

improve(redis): Address various type & usage complaints#3178

Open
pxrl wants to merge 7 commits intomasterfrom
pxrl/redisFix
Open

improve(redis): Address various type & usage complaints#3178
pxrl wants to merge 7 commits intomasterfrom
pxrl/redisFix

Conversation

@pxrl
Copy link
Copy Markdown
Collaborator

@pxrl pxrl commented Apr 8, 2026

Another step on the road towards noImplicitAny: true.

Also address various concurrency/usage issues that Claude has shaken out of the implementation.

Another step on the road towards noImplicitAny: true.

Also address various concurrency/usage issues that Claude has shaken out
of the implementation.
Comment on lines -87 to +86
return this.decrBy(this.getNamespacedKey(key), 1);
return this.decrBy(key, 1);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

decrBy() alsow imposes a namespace on key, so this was causing double-encapsulation.

@pxrl pxrl changed the title improve(redis): Address various type complaints improve(redis): Address various type & usage complaints Apr 8, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8577e7b050

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pxrl
Copy link
Copy Markdown
Collaborator Author

pxrl commented Apr 8, 2026

@codex review

Comment on lines +47 to +50
try {
activeInstance = await this.redis.get<string>(this.identifier);
consecutiveErrors = 0;
} catch (err) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

If redis.get(...) failed then this could potentially hang indefinitely. Permit it to loop up to 10 times before bailing.

Comment on lines +31 to +34
if (!isDefined(redisClients[redisInstanceKey])) {
// Store the promise immediately so concurrent callers share the same connection attempt.
redisClients[redisInstanceKey] = _createRedisClient(logger, url, namespace);
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

First assign a promise to avoid a potential race condition where a second redis client is instantiated whilst the first is awaited.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9187ff2274

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pxrl
Copy link
Copy Markdown
Collaborator Author

pxrl commented Apr 8, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b52a32f023

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant