Skip to content

Fix config flow: button text and error message#3

Closed
marcinbauer-ohf wants to merge 2 commits intodevfrom
fix/config-flow-button-and-error-message
Closed

Fix config flow: button text and error message#3
marcinbauer-ohf wants to merge 2 commits intodevfrom
fix/config-flow-button-and-error-message

Conversation

@marcinbauer-ohf
Copy link
Copy Markdown
Owner

Proposed change

Two bug fixes in the config flow dialog:

1. "Skip and finish" button text when area picker is cleared

Clearing the area picker still added the device to _deviceUpdate with an empty area value, making Object.keys(_deviceUpdate).length truthy. This caused the button to show "Finish" instead of "Skip and finish" even when no area was selected.

Fix checks for meaningful updates (non-empty name or area) using .some() instead of just checking for entry presence.

2. Config flow error showing "Unknown error" instead of actual message

handleFetchPromise throws a plain object { error, body, status_code }, not a standard Error instance, so err.message is always undefined. The error handler only checked err.message || err.body, missing err.error entirely. Every network-level failure (connection refused, CORS, etc.) showed "Unknown error".

Fix checks in priority order: err.messageerr.body.message (when body is a JSON object) → err.bodyerr.error"Unknown error".

Screenshots

No visual changes (button text fix is behavioral, error message fix only affects error dialogs).

Type of change

  • Bugfix (non-breaking change which fixes an issue)

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to backend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

To help with the load of incoming pull requests:

marcinbauer-ohf and others added 2 commits May 8, 2026 09:04
Clearing the area picker still added the device to `_deviceUpdate` with
an empty area, making `Object.keys(_deviceUpdate).length` truthy and
showing "Finish" instead of "Skip and finish".

Fix checks for meaningful updates (non-empty name or area) instead of
mere presence of entries in the update map.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
`handleFetchPromise` throws `{ error, body, status_code }` — not a
standard Error instance — so `err.message` is always undefined. The
error handler only checked `err.message || err.body`, missing `err.error`
entirely, causing every network-level failure to show "Unknown error".

Also extract `err.body.message` when the body is a JSON object rather
than JSON-stringifying the whole object.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@marcinbauer-ohf marcinbauer-ohf deleted the fix/config-flow-button-and-error-message branch May 8, 2026 07:25
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