Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix error in metrics.ts related to this.#cacheMissWindows.delete(firstKey) #1351

Closed
schaeferka opened this issue Oct 29, 2024 · 0 comments · Fixed by #1352
Closed
Assignees

Comments

@schaeferka
Copy link
Contributor

Describe what should be investigated or refactored

this.#cacheMissWindows.delete(firstKey) is generating an error related to it possibly being undefined. This should be investigated and fixed.

Links to any relevant code

    if (maxCacheMissWindows !== undefined && this.#cacheMissWindows.size >= maxCacheMissWindows) {
      const firstKey = this.#cacheMissWindows.keys().next().value;
      this.#cacheMissWindows.delete(firstKey);
      this.#gauges.get(this.#getMetricName(this.#metricNames.cacheMiss))?.remove({ window: firstKey });
    }

Additional context

Error message:
Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.ts(2345)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant