Skip to content

ui: display error dialog when saving subnet routes fails#604

Merged
agottardo merged 1 commit into
mainfrom
angott/26175
Jan 29, 2025
Merged

ui: display error dialog when saving subnet routes fails#604
agottardo merged 1 commit into
mainfrom
angott/26175

Conversation

@agottardo

Copy link
Copy Markdown
Contributor

Fixes tailscale/corp#26175

When setting subnet routing settings, for a variety of reasons the Tailscale backend may reject an entered value with a 400 error. Here we handle such errors in a user-facing fashion:

  • We display an ErrorDialog with title 'Failed to save' and whatever error message the backend request returned. To do so, we introduce a new initializer for ErrorDialog that accepts a runtime-generated String instead of a fixed string resource.
  • We ask the backend to provide an updated value of AdvertiseRoutes whenever the error dialog is dismissed by the user, and set it as the UI state, to ensure consistency between UI and backend upon a failed save.

Fixes tailscale/corp#26175

When setting subnet routing settings, for a variety of reasons the Tailscale backend may reject an entered value with a 400 error. Here we handle such errors in a user-facing fashion:

- We display an ErrorDialog with title 'Failed to save' and whatever error message the backend request returned. To do so, we introduce a new initializer for ErrorDialog that accepts a runtime-generated String instead of a fixed string resource.
- We ask the backend to provide an updated value of AdvertiseRoutes whenever the error dialog is dismissed by the user, and set it as the UI state, to ensure consistency between UI and backend upon a failed save.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
@agottardo agottardo merged commit 56d7be3 into main Jan 29, 2025
@agottardo agottardo deleted the angott/26175 branch January 29, 2025 18:03
nadeemakhter0602 pushed a commit to nadeemakhter0602/TailMon that referenced this pull request Mar 22, 2026
Fixes tailscale/corp#26175

When setting subnet routing settings, for a variety of reasons the Tailscale backend may reject an entered value with a 400 error. Here we handle such errors in a user-facing fashion:

- We display an ErrorDialog with title 'Failed to save' and whatever error message the backend request returned. To do so, we introduce a new initializer for ErrorDialog that accepts a runtime-generated String instead of a fixed string resource.
- We ask the backend to provide an updated value of AdvertiseRoutes whenever the error dialog is dismissed by the user, and set it as the UI state, to ensure consistency between UI and backend upon a failed save.

Signed-off-by: Andrea Gottardo <andrea@gottardo.me>
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.

2 participants