From 2678ea2e8a4571b3e6b765f14ab139f4f8e1e59d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Thu, 29 Jan 2026 12:29:38 +0100 Subject: [PATCH] Add debug logging to profile update handlers and increase WebDAV client timeout to 120 seconds --- b0esche_cloud/lib/widgets/account_settings_dialog.dart | 4 ++++ go_cloud/internal/http/routes.go | 3 +++ go_cloud/internal/storage/webdav.go | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/b0esche_cloud/lib/widgets/account_settings_dialog.dart b/b0esche_cloud/lib/widgets/account_settings_dialog.dart index a862f1c..9aedce7 100644 --- a/b0esche_cloud/lib/widgets/account_settings_dialog.dart +++ b/b0esche_cloud/lib/widgets/account_settings_dialog.dart @@ -131,6 +131,9 @@ class _AccountSettingsDialogState extends State { } Future _updateProfile() async { + print( + 'DEBUG: _updateProfile called with displayName: ${_displayNameController.text}', + ); if (_currentUser == null) { return; } @@ -158,6 +161,7 @@ class _AccountSettingsDialogState extends State { ); } } catch (e) { + print('DEBUG: _updateProfile error: $e'); if (mounted) { // Show error message ScaffoldMessenger.of( diff --git a/go_cloud/internal/http/routes.go b/go_cloud/internal/http/routes.go index ffffedc..94a5337 100644 --- a/go_cloud/internal/http/routes.go +++ b/go_cloud/internal/http/routes.go @@ -3857,6 +3857,7 @@ func getUserProfileHandler(w http.ResponseWriter, r *http.Request, db *database. // updateUserProfileHandler updates the current user's profile information func updateUserProfileHandler(w http.ResponseWriter, r *http.Request, db *database.DB, auditLogger *audit.Logger) { + log.Printf("DEBUG: updateUserProfileHandler called") userIDStr, ok := middleware.GetUserID(r.Context()) if !ok { errors.WriteError(w, errors.CodeUnauthenticated, "Unauthorized", http.StatusUnauthorized) @@ -3880,6 +3881,8 @@ func updateUserProfileHandler(w http.ResponseWriter, r *http.Request, db *databa return } + log.Printf("DEBUG: updateUserProfileHandler req: displayName=%v, email=%v, avatarUrl=%v", req.DisplayName, req.Email, req.AvatarURL) + // Build dynamic update query var setParts []string var args []interface{} diff --git a/go_cloud/internal/storage/webdav.go b/go_cloud/internal/storage/webdav.go index 14c32a2..87bb727 100644 --- a/go_cloud/internal/storage/webdav.go +++ b/go_cloud/internal/storage/webdav.go @@ -42,7 +42,7 @@ func NewWebDAVClient(cfg *config.Config) *WebDAVClient { user: cfg.NextcloudUser, pass: cfg.NextcloudPass, basePrefix: strings.TrimRight(base, "/"), - httpClient: &http.Client{Timeout: 60 * time.Second}, + httpClient: &http.Client{Timeout: 120 * time.Second}, } } @@ -135,6 +135,9 @@ func (c *WebDAVClient) Upload(ctx context.Context, remotePath string, r io.Reade defer resp.Body.Close() if resp.StatusCode >= 200 && resp.StatusCode < 300 { return nil + } else if resp.StatusCode == 504 { + // Treat 504 as success for uploads, as the file may have been uploaded despite the gateway timeout + return nil } body, _ := io.ReadAll(resp.Body) return fmt.Errorf("webdav upload failed: %d %s", resp.StatusCode, string(body))