Skip to content

feat: user friendly error messages - #4397

Open
mpivchev wants to merge 6 commits into
masterfrom
friendly-errors
Open

mpivchev wants to merge 6 commits into
masterfrom
friendly-errors

Conversation

@mpivchev

@mpivchev mpivchev commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Removes technical server error strings with more appropriate (and generic) user readable strings. NKLog still prints the proper server errors.

Error messages are generated based on context (ex, user is transferring a file but it fails), and if no context can be found, it relies on a generic message coming from NextcloudKit.

Ex: 507: Storage quota is reached becomes There is not enough storage space left on the server. etc.

What changes

  • NCErrorContext: Categorizes an error based on user context (moving, uploading, deleting etc). It generates errors based on said context, ex. Couldn't delete "Report.pdf".
  • NKError.userFriendlyMessage(for:) returns an error, in the following order, whichever is not empty:
    1. the app's own text (localization keys, app error codes)
    2. three operation-specific messages where the generic one would be wrong
    3. NextcloudKit's localizedGenericMessage
  • Operation-specific messages: a virus detected on upload, an upload into a folder that no longer exists (409), and creating a folder whose parent is gone.

Related: nextcloud/NextcloudKit#267
Blocked by: nextcloud/docker-ci#1011

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@mpivchev
mpivchev marked this pull request as ready for review October 20, 2026 14:35
Copilot AI balanced review requested due to automatic review settings October 20, 2026 14:35
…ly-errors

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Error classification and filename handling can produce misleading or unrecognizable failure messages.

2 open issues
What changed in this PR

Introduces user-friendly error messages across the iOS client while retaining technical details in logs.

Changes:

  • Adds operation-specific titles and centralized message selection using NextcloudKit.
  • Updates banners and saved transfer errors to use friendly messages.
  • Adds unit tests, localization strings, and project integration.
File Description
Tests/​NextcloudUnitTests/​NKErrorUserFriendlyMessageTests.swift Tests message selection and contexts.
Nextcloud.xcodeproj/​project.xcworkspace/​xcshareddata/​swiftpm/​Package.resolved Updates dependency resolutions.
Nextcloud.xcodeproj/​project.pbxproj Registers sources and changes NextcloudKit branch.
iOSClient/​Viewer/​NCViewerRichdocuments/​NCViewerRichdocuments.swift Migrates document error banners.
iOSClient/​Viewer/​NCViewerQuickLook/​NCViewerQuickLook.swift Adds upload error context.
iOSClient/​Viewer/​NCViewerProviderContextMenu.swift Adds transfer error context.
iOSClient/​Viewer/​NCViewerDirectEditing/​NCViewerDirectEditing.swift Migrates editing error banners.
iOSClient/​Trash/​NCTrash+Networking.swift Migrates trash error banners.
iOSClient/​Transfers/​NCTransfersModel.swift Displays friendly saved errors.
iOSClient/​Terms of service/​NCTermOfServiceModel.swift Migrates terms error banners.
iOSClient/​Supporting Files/​en.lproj/​Localizable.strings Adds error wording and removes older strings.
iOSClient/​Settings/​E2EE/​NCManageE2EEView.swift Migrates encryption error banners.
iOSClient/​Settings/​E2EE/​NCManageE2EEModel.swift Passes structured encryption errors.
iOSClient/​Settings/​AutoUpload/​Utility/​NCAutoUploadCounter.swift Uses friendly suspension messages.
iOSClient/​Select/​NCSelect.swift Adds transfer error context.
iOSClient/​Notification/​NCNotification.swift Migrates notification error banners.
iOSClient/​Networking/​NKError+UserFriendlyMessage.swift Centralizes friendly message selection.
iOSClient/​Networking/​NCNetworking+TransferDelegate.swift Handles missing-file errors explicitly.
iOSClient/​Networking/​NCErrorContext.swift Defines operation contexts and titles.
iOSClient/​Menu/​NCContextMenuComment.swift Migrates comment error banners.
iOSClient/​Main/​NCDragDrop.swift Adds transfer contexts.
iOSClient/​Main/​Create/​NCCreate.swift Handles missing creation metadata.
iOSClient/​Main/​Collection Common/​NCCollectionViewCommon+UIEditMenuInteractionDelegate.swift Adds upload error context.
iOSClient/​Main/​Collection Common/​NCCollectionViewCommon+Search.swift Migrates search error banners.
iOSClient/​Main/​Collection Common/​NCCollectionViewCommon+CollectionViewDelegate.swift Adds download error context.
iOSClient/​Main/​Collection Common/​NCCollectionViewCommon.swift Adds transfer failure titles.
iOSClient/​Main/​Collection Common/​Cell/​NCListCell.swift Displays friendly list errors.
iOSClient/​Main/​Collection Common/​Cell/​NCGridCell.swift Displays friendly grid errors.
iOSClient/​GUI/​Lucid Banner/​ErrorBannerView.swift Formats friendly banners and logs technical errors.
iOSClient/​Data/​NCManageDatabase+Metadata.swift Derives messages from saved errors.
iOSClient/​Activity/​NCActivity.swift Migrates activity error banners.

Review effort: Balanced

Comment thread iOSClient/Data/NCManageDatabase+Metadata.swift
Comment thread iOSClient/Networking/NKError+UserFriendlyMessage.swift
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