-
Notifications
You must be signed in to change notification settings - Fork 215
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
(fix) - O3-4349 - open workspace in declared workspace group #1266
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Size Change: -142 kB (-2.24%) Total Size: 6.19 MB
ℹ️ View Unchanged
|
@@ -301,7 +301,7 @@ export function launchWorkspace< | |||
const workspace = getWorkspaceRegistration(name); | |||
const currentWorkspaceGroup = store.getState().workspaceGroup; | |||
|
|||
if (currentWorkspaceGroup && !currentWorkspaceGroup.members?.includes(name)) { | |||
if (currentWorkspaceGroup && !(currentWorkspaceGroup.members?.includes(name) || workspace?.groups.includes(currentWorkspaceGroup.name))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chibongho, instead of adding conditions here, we have all the members of a workspaceGroup in the workspaceGroup
store and the groups
adds the given workspace to the members of a workspaceGroup at this place. Hence all the workspaces are in the end added in the to the workspaceGroup's members.
One thing that might be happening is that there might be a race condition going on in the above function, hence the group's definition might be overrided. This is something which must be looked into.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasharma05 - is this something you are able to fix? Do you know where the proper fix is? @ibacher ? This is trying to fix a regression in our system that has been broken for the last few days and arose (we think) following this commit: a61deb8 . @ibacher any guidance appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @mseaton, I made the change. Let me have a look at it.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chibongho, we connected on a meeting, and it was working well at that time, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chibongho is not 100% available today, but he and I met about this and were able to reproduce it locally as well as on our testing server. I'm not sure why it may have appeared working at the time, but it is an issue for both of us now @vasharma05
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into it @mseaton, will there be a way that I can use your implementation to reproduce the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll DM you on slack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mseaton @chibongho, it's the race condition between the workspaceGroup
registration by the ward-app and the custom workspace's group
property.
Correction: It's not a race condition, actually the registerWorkspaceGroup
overrides the already registered workspace group and it's members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasharma05 - shouldn't your PR remove this change made by @chibongho , if your follow-up change fixes things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @mseaton, pushed the commit.
…roup is registered beforehand
UpdateThe workspace registration adds a new entry in the Workspace registering before the workspace group is registeredScreen.Recording.2025-01-15.at.22.40.06.movP.S. The change done by @chibongho was reverted before the above flow is recorded. |
@ibacher, requesting your review here. |
@@ -164,28 +182,8 @@ function createNewWorkspaceGroupInfo(groupName: string): WorkspaceGroupRegistrat | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function above this is no longer used or needed, right @vasharma05 - createNewWorkspaceGroupInfo
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, forgot to clean it up
@@ -164,28 +182,8 @@ function createNewWorkspaceGroupInfo(groupName: string): WorkspaceGroupRegistrat | |||
} | |||
|
|||
export function attachWorkspaceToGroup(workspaceName: string, groupName: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need this new function now? All it does is delegate to another existing function with basically the same arguments, right?
Couldn't any code that calls attachWorkspaceToGroup(workspaceName, groupName)
instead just call registerWorkspaceGroup({name: groupName, members: [workspaceName]});
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I think this is good to go to merge. Any objections @ibacher ? |
Requirements
feat
,fix
, orchore
, among others). See existing PR titles for inspiration.For changes to apps
If applicable
Summary
We want to support both:
I think there was a regression with this commit that dropped support for 2. This PR adds it back.
Screenshots
"Visit Summary" is a workspace that we define in a PIH custom ESM. It declares that it belongs to the
ward-patient
workspace group.Before:
(notice the workspace action menu icons fail to load)
After:
Related Issue
Other
I don't know why, but as seen in the screenshot, the content of the workspace is blank when I run
yarn run:shell
fromesm-core
. It seems not related to this change. It also doesn't seem to be a real issue in dev3, or when runningyarn start --sources esm-ward-app
in patient-management locally