Skip to content

fix: system workspace loading - #7731

Merged
fit2cloudwxx merged 1 commit into
v3from
pr@v3@fix_sysWorkspaceLoading
Nov 9, 2026
Merged

fit2cloudwxx merged 1 commit into
v3from
pr@v3@fix_sysWorkspaceLoading

Conversation

@shaohuzhang1

@shaohuzhang1 shaohuzhang1 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

【【工作空间】系统管理员删除工作空间后,一直处于loading状态,刷新页面后恢复】
https://www.tapd.cn/tapd_fe/45245355/bug/detail/1145245355001078886

})
}),
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Code Review

Improvements in the new version (good):

  1. finally ensures workspaceLoading resets even on error — fixes a potential "stuck spinner" bug in the old code.
  2. Always refreshing the list after deletion, and passing the current workspace ID to preserve selection, is more robust than only refreshing when the deleted item was selected.

Remaining issues / suggestions:

  1. Unhandled errors: If deleteWorkspace or loadWorkspaceOptions rejects, the error propagates with no user feedback. Add .catch:
    return WorkspaceApi.deleteWorkspace(workspace.id)
      .then(...)
      .catch((e) => MsgError(e?.message || '删除失败'))
      .finally(...)
  2. MsgConfirm rejection noise: Clicking "cancel" typically rejects the promise, producing an unhandled rejection. Wrap it:
    MsgConfirm(...).then(...).catch(() => { /* 用户取消 */ })
  3. workspace.id as string cast: Avoidable type assertion (as string) hides possible undefined. Validate first:
    if (!workspace.id) return
  4. Selection loss edge case: If the API supports it, better UX is to have the backend return which workspace was auto-switched to after deletion, instead of guessing client-side. Also confirm loadWorkspaceOptions(id) actually handles "the passed ID was just deleted" (it should fall back to the first item).
  5. Minor: Success message before refresh is fine, but consider moving MsgSuccess after loadWorkspaceOptions succeeds so toast reflects the full operation.

@fit2cloudwxx
fit2cloudwxx merged commit 9a91305 into v3 Nov 9, 2026
3 of 4 checks passed
@fit2cloudwxx
fit2cloudwxx deleted the pr@v3@fix_sysWorkspaceLoading branch November 9, 2026 02:34
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