Repository navigation
fix storage superforms - #399
Open
Bohreromir wants to merge 3 commits into
Open
Bohreromir wants to merge 3 commits into
Bohreromir wants to merge 3 commits into
Conversation
The storage connect and connection edit forms came in with the S3 file browser merge and missed the fixes from #346. - Show network and server failures in the form instead of the error page (onError, caught save/session/update errors) - Translate schema validation messages; an untouched host now reports "Host is required" instead of zod's default - Treat a cleared port field (null) as the default port - Return translated errors from the use/delete actions and show them - Replace the hand-rolled unsaved-changes guard on the edit page with superforms' taintedMessage - Always test the connection when editing, with the stored credentials if none are entered - Share the connection test error mapping and detect network errors by error code (AggregateError for localhost has an empty message) - Log through locals.logger in the edit action
- Only test the connection on edit when endpoint or credentials changed, so a rename still saves while the backend is unreachable - Explain connection test failures in the use action like elsewhere - Add the deleteConnection action to the edit route, which the sidebar posts to, and share the delete action body in a helper - Detect TLS protocol errors, SDK timeouts and nested causes as network errors - Skip the reload after saving an edit and drop the effect that settled the unsaved-changes dialog - Add unit tests for the edit update action
- Show a failed sidebar delete on the connection edit page - Save and activate a new connection in separate steps, so an activation failure no longer claims the connection was not saved - Send sidebar deletes with enhance and ask about unsaved changes before the delete is sent, in the app instead of the browser's leave prompt; a failed delete brings the unsaved changes back - Drop deleted connections from the edit page sidebar - Wait for the list to change in the e2e cleanup helper now that deletes no longer reload the page - Add e2e tests for the edit page sidebar: switching connections, delete with and without unsaved changes, failed delete
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes several bugs in the storage connection forms (connect, edit, delete) and makes failures show up inside the form instead of on the error page.
Validation (
src/lib/storage/schemas.ts)messages/en.json,messages/de.json) instead of hard-coded English.null) or an empty field ('') now means "default port". Before, coercion turned both into0and validation failed.Connection test errors (
src/lib/server/storage/connection-test-error.ts)connectionTestErrorMessage()that maps connection-test failures to translated messages. It covers HTTP status codes,AggregateError,causechains,EPROTO/ERR_SSL_*andTimeoutError.Error handling in actions
/storageconnectanduse: failures to save, activate the connection or update the session now return a form error instead of throwing.storage_connect_save_failed) instead of throwing.deleteConnectionAction(src/lib/server/storage/delete-connection-action.ts). It is used by/settings/connectionsand by the edit page's sidebar. If the delete fails, the page shows an inline alert.Edit page
taintedMessagewith the in-app modal. The browserconfirmis no longer used.deleteConnectionaction on the edit page, so the connection sidebar can delete from there. A newConnectionEditGuardcontext (src/lib/storage/context.ts) lets the sidebar ask whether to discard unsaved edits before deleting, and restore them if the delete fails.