Skip to content

Fix duplicate key risks in Svelte each blocks#3208

Open
Alex-Tideman wants to merge 3 commits intocodefreeze-03.02.26from
each-block-key-audit
Open

Fix duplicate key risks in Svelte each blocks#3208
Alex-Tideman wants to merge 3 commits intocodefreeze-03.02.26from
each-block-key-audit

Conversation

@Alex-Tideman
Copy link
Collaborator

High risk fixes:

  • workflow-callback: change || to ?? so falsy eventId/requestId values don't skip to index fallback
  • combobox: add (v) key to multiselect chip rendering
  • schedule-recent-runs: prefix index fallback with _ to prevent collisions with real workflow/run IDs

Medium risk fixes:

  • Add stable id field to SearchAttributeFilter type with generateFilterId() factory, replacing fragile attribute-index composite keys in filter-list, dropdown-filter-list (workflow and activity variants)
  • Drop redundant index from column keys in orderable-list and event-summary-table where labels are already unique
  • Update all SearchAttributeFilter construction sites to include id
  • Update tests to use toMatchObject for filter assertions

Description & motivation 💭

Screenshots (if applicable) 📸

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

High risk fixes:
- workflow-callback: change || to ?? so falsy eventId/requestId values
  don't skip to index fallback
- combobox: add (v) key to multiselect chip rendering
- schedule-recent-runs: prefix index fallback with _ to prevent
  collisions with real workflow/run IDs

Medium risk fixes:
- Add stable id field to SearchAttributeFilter type with
  generateFilterId() factory, replacing fragile attribute-index
  composite keys in filter-list, dropdown-filter-list (workflow and
  activity variants)
- Drop redundant index from column keys in orderable-list and
  event-summary-table where labels are already unique
- Update all SearchAttributeFilter construction sites to include id
- Update tests to use toMatchObject for filter assertions
@Alex-Tideman Alex-Tideman requested a review from rossedfort as a code owner March 3, 2026 16:30
@vercel
Copy link

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Mar 3, 2026 4:42pm

Request Review

</Link>
</div>
{#each sortRecentRuns(recentRuns) as run, i (`${run?.startWorkflowResult?.workflowId ?? i}:${run?.startWorkflowResult?.runId ?? i + 1}`)}
{#each sortRecentRuns(recentRuns) as run, i (`${run?.startWorkflowResult?.workflowId ?? `_${i}`}:${run?.startWorkflowResult?.runId ?? `_${i}`}`)}
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
  • ⚠️ 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
  • ⚠️ Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
  • ⚠️ Type 'string | null | undefined' is not assignable to type 'string | undefined'.

@temporal-cicd
Copy link
Contributor

temporal-cicd bot commented Mar 3, 2026

Warnings
⚠️

📊 Strict Mode: 61 errors in 12 files (5.5% of 1109 total)

src/lib/holocene/combobox/combobox.svelte (10)
  • L150:4: Type 'null' is not assignable to type 'string'.
  • L153:4: Type 'null' is not assignable to type '"activity" | "add-square" | "add" | "apple" | "archives" | "arrow-down" | "arrow-left" | "arrow-up" | "arrow-right" | "ascending" | "astronaut" | "batch-operation" | "book" | ... 129 more ... | "xmark-square"'.
  • L155:4: Type 'null' is not assignable to type 'keyof T'.
  • L224:4: 'inputElement' is possibly 'null'.
  • L225:4: 'inputElement' is possibly 'null'.
  • L231:14: Argument of type 'string | T | undefined' is not assignable to parameter of type 'string | T'.
  • L236:14: Argument of type 'string | T | undefined' is not assignable to parameter of type 'string | T'.
  • L269:60: Function lacks ending return statement and return type does not include 'undefined'.
  • L362:10: Type 'HTMLLIElement | null' is not assignable to type 'HTMLLIElement'.
  • L362:43: 'menuElement' is possibly 'null'.
src/lib/utilities/query/to-list-workflow-filters.ts (3)
  • L47:60: Function lacks ending return statement and return type does not include 'undefined'.
  • L48:17: Type 'undefined' is not assignable to type 'Duration'.
  • L104:10: Type 'string | null' is not assignable to type 'string'.
src/lib/components/schedule/schedule-recent-runs.svelte (11)
  • L38:6: Type 'string | undefined' is not assignable to type 'string'.
  • L48:81: 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
  • L48:81: Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
  • L48:118: Type 'string | null | undefined' is not assignable to type 'string | undefined'.
  • L48:125: 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
  • L56:14: Type 'string | null | undefined' is not assignable to type 'string'.
  • L56:24: 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
  • L57:14: Type 'string | null | undefined' is not assignable to type 'string'.
  • L57:19: 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
  • L61:13: 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
  • L72:11: 'run.startWorkflowResult' is possibly 'null' or 'undefined'.
src/lib/components/search-attribute-filter/filter-list.svelte (1)
  • L44:6: Type 'null' is not assignable to type 'number'.
src/lib/components/standalone-activities/activity-counts.svelte (7)
  • L85:8: Type 'string | null' is not assignable to type 'string'.
  • L89:38: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  • L90:54: Argument of type 'never[] | { count: string; groupValues: IPayloads; }[] | undefined' is not assignable to parameter of type 'never[] | undefined'.
  • L101:8: Type 'string | null' is not assignable to type 'string'.
  • L105:41: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  • L106:57: Argument of type 'never[] | { count: string; groupValues: IPayloads; }[] | undefined' is not assignable to parameter of type 'never[] | undefined'.
  • L154:14: Object is possibly 'undefined'.
src/lib/components/workflow/filter-bar/status-dropdown-filter-chip.svelte (4)
  • L21:38: Type 'null' is not assignable to type 'number'.
  • L110:44: Argument of type 'string | null' is not assignable to parameter of type 'string'.
  • L116:14: Type '"All" | WorkflowStatus' is not assignable to type 'string | undefined'.
  • L114:50: Argument of type 'string | null' is not assignable to parameter of type 'string'.
src/lib/components/standalone-activities/activities-summary-filter-bar/dropdown-filter-list.svelte (4)
  • L77:23: '$activeQueryIndex' is possibly 'null'.
  • L78:6: '$activeQueryIndex' is possibly 'null'.
  • L96:10: Type 'number | null' is not assignable to type 'number | undefined'.
  • L103:10: Type 'number | null' is not assignable to type 'number | undefined'.
src/lib/components/workflow/workflow-callback.svelte (8)
  • L38:11: Type 'null' cannot be used as an index type.
  • L38:11: Type 'undefined' cannot be used as an index type.
  • L52:17: 'link.workflowEvent' is possibly 'null' or 'undefined'.
  • L53:36: Type 'string | null | undefined' is not assignable to type 'string'.
  • L53:47: 'link.workflowEvent' is possibly 'null' or 'undefined'.
  • L61:15: 'link.workflowEvent' is possibly 'null' or 'undefined'.
  • L62:34: Type 'string | null | undefined' is not assignable to type 'string'.
  • L62:45: 'link.workflowEvent' is possibly 'null' or 'undefined'.
src/lib/components/workflow/workflow-counts.svelte (8)
  • L48:25: Parameter 'status' implicitly has an 'any' type.
  • L89:8: Type 'string | null' is not assignable to type 'string'.
  • L93:38: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  • L94:46: Argument of type 'never[] | { count: string; groupValues: IPayloads; }[] | undefined' is not assignable to parameter of type 'never[] | undefined'.
  • L105:8: Type 'string | null' is not assignable to type 'string'.
  • L109:41: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  • L110:49: Argument of type 'never[] | { count: string; groupValues: IPayloads; }[] | undefined' is not assignable to parameter of type 'never[] | undefined'.
  • L160:14: Object is possibly 'undefined'.
src/lib/components/workflow/workflows-summary-configurable-table/filterable-table-cell.svelte (1)
  • L68:11: Type 'string | undefined' is not assignable to type 'string'.
src/lib/components/workflow/filter-bar/dropdown-filter-list.svelte (1)
  • L72:6: Type 'null' is not assignable to type 'number'.
src/lib/components/workflow/dropdown-filter/workflow-status.svelte (3)
  • L104:45: Argument of type 'string | null' is not assignable to parameter of type 'string'.
  • L107:12: Type '"All" | WorkflowStatus' is not assignable to type 'string | undefined'.
  • L110:42: Argument of type 'string | null' is not assignable to parameter of type 'string'.

Generated by 🚫 dangerJS against 969fb0e

Detailed explanation of every each block key change, the specific
problem each fix addresses, and which items were reviewed and
intentionally left unchanged.
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