Skip to content

Validate AUTO_WIFI_ON_INTERVAL range - #828

Merged
jurgelenas merged 7 commits into
masterfrom
fix-524-auto-wifi-interval-validation
Oct 25, 2026
Merged

jurgelenas merged 7 commits into
masterfrom
fix-524-auto-wifi-interval-validation

Conversation

@jurgelenas

Copy link
Copy Markdown
Member

Fixes #524. Supersedes #789 and keeps its commits.

On top of #789:

  • Regenerate GraphQL types so min/max are actually fetched
  • Pass number options to PlatformIO builds
  • Allow 0 (firmware starts WiFi immediately)
  • Show helper text only on invalid values
  • Fix yarn gql-codegen with the authenticated API (API_AUTH_TOKEN)

grzella and others added 7 commits October 25, 2026 14:36
The auto-WiFi interval field accepted any text. It now renders as a numeric
input constrained to 1-2147483 seconds (the firmware stores the interval in
int32 milliseconds, hence the upper bound) and shows an inline error when the
value is not a whole number in range.

Fixes #524
Per review: instead of a hardcoded range map in the UI, add a Number kind to
UserDefineKind with optional min/max fields on UserDefine, set them in
TargetUserDefinesFactory (min 1, max 2147483), expose min/max over GraphQL, and
have UserDefinesList derive validation purely from the model.
…lowed range

Review feedback: the visual error alone did not block submission (a manually
typed -11111 was accepted) and min/max were not shown until an error appeared.

- UserDefinesValidator: add validateNumericRanges — an out-of-range or non-integer
  Number user-define now produces a validation error, which blocks the build/flash
  (same gate as regulatory-domain / binding-phrase validation).
- UserDefinesList: helper text now always shows the allowed range, switching to the
  out-of-range message when invalid.
- Add UserDefinesValidator.test.ts covering below-min/above-max/non-integer/disabled.
…ng path)

Adds integration-level assertions that an out-of-range numeric user-define
surfaces through validate() (the gate ConfiguratorView uses to block the build),
not just through the validateNumericRanges sub-method.
Regenerate GraphQL types so min/max are fetched, emit the build flag for number options, allow 0 and only show helper text on errors.
@jurgelenas
jurgelenas merged commit 799a4a1 into master Oct 25, 2026
3 checks passed
@jurgelenas
jurgelenas deleted the fix-524-auto-wifi-interval-validation branch October 25, 2026 12:47
@github-actions

Copy link
Copy Markdown

📦 Build artifacts

View workflow run

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.

Add min,max validation for AUTO_WIFI_ON_INTERVAL

2 participants