Comfy-Org / Comfy-Org/ComfyUI_frontend

Fix nullability of settingsStore.ts

Open
#4,366 9 comments 0 reactions 0 assignees View on GitHub
area:settings verified bug
Dominant language
TypeScript
Stars
2k
Forks
702
Avg merge
1d 8h
Merged PRs (30d)
512

Description

`SettingParams` is used as a non-nullable type in several parameters throughout `settingsStore.ts`, however it is called using indexed accessor notation, and tsconfig is not set up to register that this may be nullable.

In several places, optional chaining is used, but not in others. No errors are recorded because TS believes that this value cannot be null.

If true, the optional chaining needs to be removed (see below for inconsistent optional chaining).

If false, fix the undefined prop access.

https://github.com/Comfy-Org/ComfyUI_frontend/blob/1e7aaa42dc56f432754c1cd2a51dc77869eb8d5d/src/stores/settingStore.ts#L28-L35

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-4366-Fix-nullability-of-settingsStore-ts-2286d73d365081ae98c0dca34e166efb) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Research direction

Read src/stores/settingStore.ts at lines 28-35 and inspect the relevant tsconfig settings for indexed access nullability. Use the TypeScript check to determine whether the accessor can be undefined; done means the optional chaining and undefined-property handling are consistent and the nullability diagnostics are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.