Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MS] Batch workspace sharing #8900

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Ironicbay
Copy link
Contributor

@Ironicbay Ironicbay commented Nov 12, 2024

Closes #8326

Enregistrement.de.l.ecran.2024-11-18.a.10.57.40.mov

@Ironicbay Ironicbay requested a review from a team as a code owner November 12, 2024 16:01
@Ironicbay Ironicbay marked this pull request as draft November 12, 2024 16:01
client/src/views/workspaces/WorkspaceSharingModal.vue Outdated Show resolved Hide resolved
client/src/views/workspaces/WorkspaceSharingModal.vue Outdated Show resolved Hide resolved
client/src/views/workspaces/WorkspaceSharingModal.vue Outdated Show resolved Hide resolved
client/src/views/workspaces/WorkspaceSharingModal.vue Outdated Show resolved Hide resolved
@Ironicbay Ironicbay force-pushed the ms-batch-workspace-sharing branch 3 times, most recently from 3646795 to c0d0261 Compare November 18, 2024 07:37
@Ironicbay Ironicbay marked this pull request as ready for review November 18, 2024 07:38
client/src/views/workspaces/WorkspaceSharingModal.vue Outdated Show resolved Hide resolved
client/src/views/workspaces/WorkspaceSharingModal.vue Outdated Show resolved Hide resolved
client/src/views/workspaces/WorkspaceSharingModal.vue Outdated Show resolved Hide resolved
client/src/views/workspaces/WorkspaceSharingModal.vue Outdated Show resolved Hide resolved
}
}

if (!changesMade) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Error handling is insufficient here.
You can test it in web mode by updating the mocks for shareWorkspace and add (as an example)
return { ok: false, error: { tag: ClientShareWorkspaceErrorTag.Offline, error: 'Offline' } };

The error I get is Selected members were already Contributor., which is false. I'm not even sure that this error is possible, if you try to assign the same role to a user, I think it'll just work.

Handling multiple errors is always a pain. The best thing to do imo is to count the number of successes, the number of errors, and store the first error (if any). You can then compare it to the number of operations:

  • successesCount === selectedUsers.value.length means all good
  • errorsCount === selectedUsers.value.length means all failed, probably a very general case like being offline, being revoked, having insufficient permission (you can check using the error you stored and assume it's the same for all)
  • some errors is a complicated case, but a generic error like "some failed" is probably enough

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.

[🚀 | Feature request]: Batch workspace sharing
3 participants