[PR #7824] [MERGED] fix: add open workspace assertion #8140

Closed
opened 2026-03-23 23:22:48 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7824
Author: @LucasXu0
Created: 4/24/2025
Status: Merged
Merged: 4/25/2025
Merged by: @LucasXu0

Base: mainHead: delete_workspace


📝 Commits (10+)

  • 084921f fix: add fix workspace assertion
  • 6f74cb2 fix: macos build
  • 55f6cb5 feat: add new token
  • d6ae947 feat: change min width of AFButton to 76.0
  • af584df chore: update translations
  • 623f138 feat: add verifying button
  • d48b16c feat: set barrierDismissible as false
  • ac31fe3 Merge branch 'main' into delete_workspace
  • 8bfe1b9 chore: install libcurl4-openssl-dev on Linux
  • d94c42b fix: flutter analyze

📊 Changes

46 files changed (+781 additions, -367 deletions)

View changed files

📝 .github/actions/flutter_build/action.yml (+1 -1)
📝 .github/actions/flutter_integration_test/action.yml (+1 -1)
📝 .github/workflows/flutter_ci.yaml (+2 -2)
📝 .github/workflows/release.yml (+1 -1)
📝 frontend/appflowy_flutter/integration_test/desktop/cloud/cloud_runner.dart (+29 -15)
📝 frontend/appflowy_flutter/integration_test/desktop/cloud/workspace/tabs_test.dart (+2 -2)
📝 frontend/appflowy_flutter/integration_test/desktop/uncategorized/switch_folder_test.dart (+15 -19)
📝 frontend/appflowy_flutter/lib/user/application/user_listener.dart (+8 -7)
📝 frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/continue_with_magic_link_or_passcode_page.dart (+32 -24)
📝 frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/continue_with_password_page.dart (+63 -39)
frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/forgot_password_page.dart (+245 -0)
📝 frontend/appflowy_flutter/lib/workspace/application/home/home_bloc.dart (+3 -1)
📝 frontend/appflowy_flutter/lib/workspace/application/home/home_setting_bloc.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/workspace/application/menu/menu_user_bloc.dart (+5 -2)
📝 frontend/appflowy_flutter/lib/workspace/application/user/user_workspace_bloc.dart (+30 -12)
📝 frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_user.dart (+5 -2)
📝 frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_setting.dart (+3 -4)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/about/app_version.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/account/account_deletion.dart (+44 -43)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/account/account_sign_in_out.dart (+6 -0)

...and 26 more files

📄 Description

Feature Preview

If the workspaces is empty, skip the open workspace step


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Improve workspace handling and error resilience in the UserWorkspaceBloc by adding more robust workspace fetching and deletion logic

Bug Fixes:

  • Add null checks and assertions to prevent potential null pointer exceptions when handling workspaces
  • Improve error handling when fetching current workspace by using fold method to handle potential errors

Enhancements:

  • Add logging for workspace operations to improve debugging
  • Sort workspaces by creation timestamp for consistent ordering
  • Enhance workspace switching logic to handle edge cases

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/7824 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 4/24/2025 **Status:** ✅ Merged **Merged:** 4/25/2025 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `delete_workspace` --- ### 📝 Commits (10+) - [`084921f`](https://github.com/AppFlowy-IO/AppFlowy/commit/084921f02a37c6f18214ad33895dc91471747b8a) fix: add fix workspace assertion - [`6f74cb2`](https://github.com/AppFlowy-IO/AppFlowy/commit/6f74cb2e98c8810da59cd95111012a6ad9c81c09) fix: macos build - [`55f6cb5`](https://github.com/AppFlowy-IO/AppFlowy/commit/55f6cb58fe86175ff9080efce7d10503fc376b45) feat: add new token - [`d6ae947`](https://github.com/AppFlowy-IO/AppFlowy/commit/d6ae947bca6dab29f17cd44788c3b22520b1deff) feat: change min width of AFButton to 76.0 - [`af584df`](https://github.com/AppFlowy-IO/AppFlowy/commit/af584df690339e8a220ff9d07a3b48e4828e6b39) chore: update translations - [`623f138`](https://github.com/AppFlowy-IO/AppFlowy/commit/623f138e41df27913d1b3b4e6f11690d1b6dda40) feat: add verifying button - [`d48b16c`](https://github.com/AppFlowy-IO/AppFlowy/commit/d48b16cb7be58f2d0c79a7be40e99213639a0e0c) feat: set barrierDismissible as false - [`ac31fe3`](https://github.com/AppFlowy-IO/AppFlowy/commit/ac31fe3093c106e89e8547c968e91a4668314ae6) Merge branch 'main' into delete_workspace - [`8bfe1b9`](https://github.com/AppFlowy-IO/AppFlowy/commit/8bfe1b9d2e131d7f94ffee3ac326697ec65be5ab) chore: install libcurl4-openssl-dev on Linux - [`d94c42b`](https://github.com/AppFlowy-IO/AppFlowy/commit/d94c42b06534c867dfc7554d6200838ec0c50596) fix: flutter analyze ### 📊 Changes **46 files changed** (+781 additions, -367 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/flutter_build/action.yml` (+1 -1) 📝 `.github/actions/flutter_integration_test/action.yml` (+1 -1) 📝 `.github/workflows/flutter_ci.yaml` (+2 -2) 📝 `.github/workflows/release.yml` (+1 -1) 📝 `frontend/appflowy_flutter/integration_test/desktop/cloud/cloud_runner.dart` (+29 -15) 📝 `frontend/appflowy_flutter/integration_test/desktop/cloud/workspace/tabs_test.dart` (+2 -2) 📝 `frontend/appflowy_flutter/integration_test/desktop/uncategorized/switch_folder_test.dart` (+15 -19) 📝 `frontend/appflowy_flutter/lib/user/application/user_listener.dart` (+8 -7) 📝 `frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/continue_with_magic_link_or_passcode_page.dart` (+32 -24) 📝 `frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/continue_with_password_page.dart` (+63 -39) ➕ `frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/continue_with/forgot_password_page.dart` (+245 -0) 📝 `frontend/appflowy_flutter/lib/workspace/application/home/home_bloc.dart` (+3 -1) 📝 `frontend/appflowy_flutter/lib/workspace/application/home/home_setting_bloc.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/workspace/application/menu/menu_user_bloc.dart` (+5 -2) 📝 `frontend/appflowy_flutter/lib/workspace/application/user/user_workspace_bloc.dart` (+30 -12) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/header/sidebar_user.dart` (+5 -2) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/shared/sidebar_setting.dart` (+3 -4) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/about/app_version.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/account/account_deletion.dart` (+44 -43) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/account/account_sign_in_out.dart` (+6 -0) _...and 26 more files_ </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview If the workspaces is empty, skip the open workspace step <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [ ] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. ## Summary by Sourcery Improve workspace handling and error resilience in the UserWorkspaceBloc by adding more robust workspace fetching and deletion logic Bug Fixes: - Add null checks and assertions to prevent potential null pointer exceptions when handling workspaces - Improve error handling when fetching current workspace by using fold method to handle potential errors Enhancements: - Add logging for workspace operations to improve debugging - Sort workspaces by creation timestamp for consistent ordering - Enhance workspace switching logic to handle edge cases --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:22:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8140
No description provided.