Backport #29181 task and incident utility split to 1.13 - #31052
Conversation
* perf(ui): split task, incident, and data quality utilities (#29181) * perf(ui): split task and data quality utilities * fix(ui): resolve tasks data quality lazy split * fix(ui): remove tasks utils barrel exports * fix(ui): remove duplicate query builder css import * fix(ui): dedupe task action utils mock * Update generated TypeScript types * Fix incident reopen backport build * Update generated TypeScript types --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 33b3451)
| const taskFormSchemaCache = new Map< | ||
| string, | ||
| Promise<TaskFormSchema | undefined> | ||
| >(); |
There was a problem hiding this comment.
💡 Quality: Task form schema cache uses bare Map instead of lru-cache
taskFormSchemaCache is a bare Map used as a module-level cache keyed by ${taskType}::${taskCategory} with no eviction bound. The project's caching guideline requires lru-cache over a bare Map/plain object. Impact is low here since the key space (task type × category) is finite, but consider switching to lru-cache for consistency with the codebase convention.
Use lru-cache with a bounded size instead of a bare Map.:
import { LRUCache } from 'lru-cache';
const taskFormSchemaCache = new LRUCache<
string,
Promise<TaskFormSchema | undefined>
>({ max: 100 });
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsBackports the task and incident utility split from #29181 to branch 1.13. Consider replacing the bare Map in the task form schema cache with lru-cache to prevent unbounded memory growth. 💡 Quality: Task form schema cache uses bare Map instead of lru-cache📄 openmetadata-ui/src/main/resources/ui/src/utils/TaskFormSchemaUtils.ts:59-62
Use lru-cache with a bounded size instead of a bare Map.🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
❌ UI Checkstyle Failed❌ ESLint + Prettier + Organise Imports (src)One or more source files have linting or formatting issues. ❌ Licence HeaderOne or more files are missing or have an outdated Apache 2.0 licence header. Affected files
❌ Tailwind AuditHardcoded Tailwind values found. Use a design-system utility (run ❌ Antd + Less Deprecation GuardA new Affected filesat Function._resolveFilename (node:internal/modules/cjs/loader:1401:15) Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
Summary
Tracking
Testing