Skip to content

Saved#107

Open
lehuubiensea25122003-top wants to merge 1 commit intosteipete:mainfrom
lehuubiensea25122003-top:codespace-glowing-space-umbrella-5g7gwxpq9rvv3vw7q
Open

Saved#107
lehuubiensea25122003-top wants to merge 1 commit intosteipete:mainfrom
lehuubiensea25122003-top:codespace-glowing-space-umbrella-5g7gwxpq9rvv3vw7q

Conversation

@lehuubiensea25122003-top

No description provided.

Copy link

@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: 3a5e830aae

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

loader: () => Promise<ServerDefinition[]>,
configPaths: string[]
): Promise<ServerDefinition[]> {
const cacheKey = configPaths.sort().join('|');

Choose a reason for hiding this comment

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

P2 Badge Avoid mutating configPaths when deriving the cache key

Using configPaths.sort() mutates the caller-owned array before loader() executes. If the caller relies on path order for precedence (for example, later config layers overriding earlier ones) or reuses the same array elsewhere, this helper can silently change behavior while trying to cache. Build the key from a copied array so cache key generation is side-effect free.

Useful? React with 👍 / 👎.

}
}

cache.set(cacheKey, { definitions, mtimes, timestamp: now });

Choose a reason for hiding this comment

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

P2 Badge Stamp cache entries after loading definitions completes

The cached timestamp is taken from now captured before await loader(), so slow loads consume part (or all) of the 5s TTL before the entry is even stored. When loading takes longer than the TTL, the next call immediately misses and reloads, defeating this optimization on exactly the slow environments it targets. Capture Date.now() at cache.set time instead.

Useful? React with 👍 / 👎.

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