Skip to content

Hide raw cloud config errors in settings#8790

Open
miachillgood wants to merge 2 commits into
AppFlowy-IO:mainfrom
miachillgood:fix/settings-hide-raw-cloud-errors
Open

Hide raw cloud config errors in settings#8790
miachillgood wants to merge 2 commits into
AppFlowy-IO:mainfrom
miachillgood:fix/settings-hide-raw-cloud-errors

Conversation

@miachillgood

@miachillgood miachillgood commented Jun 5, 2026

Copy link
Copy Markdown

Summary

  • replace raw cloud-config error strings in settings with user-friendly sync error copy
  • keep the failure path non-technical when cloud config cannot be loaded

Why

When settings loads while offline or cloud config fetch fails, the UI should not surface raw backend/internal error text directly to the user.

Related to #8668.

Validation

  • git diff --check

Notes

  • I could not run Dart/Flutter validation locally because this machine does not have dart or flutter installed.

Summary by Sourcery

Replace raw cloud configuration error messages in settings with localized, user-friendly sync error copy.

Bug Fixes:

  • Prevent internal cloud configuration error strings from being shown directly to users in settings by using generic sync error messaging.

Enhancements:

  • Use localized sync error title and hint text on cloud settings error pages instead of raw exception strings.

@sourcery-ai

sourcery-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces raw backend error strings shown in cloud settings with localized, user-friendly sync error messages, ensuring non-technical copy is displayed when cloud config loading fails.

Sequence diagram for localized sync error handling in cloud settings

sequenceDiagram
  actor User
  participant AppFlowyCloudViewSetting
  participant CloudConfigRepository
  participant FlowyErrorPage

  User->>AppFlowyCloudViewSetting: build
  AppFlowyCloudViewSetting->>CloudConfigRepository: loadCloudConfig
  CloudConfigRepository-->>AppFlowyCloudViewSetting: Either.left(error)
  AppFlowyCloudViewSetting->>FlowyErrorPage: message(LocaleKeys.error_syncError.tr, LocaleKeys.error_syncErrorHint.tr)
Loading

File-Level Changes

Change Details Files
Show generic, localized sync error messages instead of raw error strings when AppFlowy cloud settings loading fails.
  • Update error branch in AppFlowyCloudViewSetting to use LocaleKeys.error_syncError and LocaleKeys.error_syncErrorHint for FlowyErrorPage.message
  • Update error branch in CustomAppFlowyCloudView to use LocaleKeys.error_syncError and LocaleKeys.error_syncErrorHint for FlowyErrorPage.message instead of err.toString()
frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

Hey - I've left some high level feedback:

  • Consider ensuring that the underlying err is still logged or surfaced to observability tooling somewhere else, since replacing it with a generic localized message here removes potentially useful debugging information from the UI.
  • If not already in place, it may be worth differentiating between offline/network failures and other cloud config errors before mapping them all to the same error_syncError copy, so users can get more precise guidance when connectivity is the root cause.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider ensuring that the underlying `err` is still logged or surfaced to observability tooling somewhere else, since replacing it with a generic localized message here removes potentially useful debugging information from the UI.
- If not already in place, it may be worth differentiating between offline/network failures and other cloud config errors before mapping them all to the same `error_syncError` copy, so users can get more precise guidance when connectivity is the root cause.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@miachillgood

Copy link
Copy Markdown
Author

Follow-up pushed on the same branch. I kept the user-facing copy generic, added explicit logging for the underlying cloud-config error, and now show a more specific no-network message when the error looks connectivity-related.

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