-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Due for payment 2025-05-22] [$250] Remove unnecessary Read api call s on the workspace features pages #61061
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
Comments
Job added to Upwork: https://www.upwork.com/jobs/~021917178062594162758 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
Current assignee @mountiny is eligible for the AutoAssignerNewDotQuality assigner, not assigning anyone new. |
Triggered auto assignment to @RachCHopkins ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Remove unnecessary Read api call s on the workspace features pages What is the root cause of that problem?For some of the pages we use useFocusEffect for ex, here and some of the pages we used isFocused state inside the useEffect for ex, here . So whenever page is focused we call the API to get the data. What changes do you think we should make in order to solve the problem?To fix this issue we need to replace to useFocusEffect with useEffect. And whenever we use isFocused we should remove that and load the data only when page first time loads or whenever needed (can be checked during implementation)
App/src/pages/workspace/WorkspaceOverviewPage.tsx Lines 152 to 156 in d391099
Make same kind of changes in other pages whenever needed. What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?NA UI issue What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
ProposalPlease re-state the problem that we are trying to solve in this issue.On some workspace feature pages (e.g., Members and Report Fields), the What is the root cause of that problem?A What changes do you think we should make in order to solve the problem?We should update the following Original:useEffect(() => {
if (!isFocused) {
setSelectedEmployees([]);
return;
}
getWorkspaceMembers();
}, [isFocused]); Updated:useEffect(() => {
if (!isFocused) {
setSelectedEmployees([]);
return;
}
// Avoid unnecessary API call if employee list already exists
if (isEmptyObject(policy?.employeeList)) {
getWorkspaceMembers();
}
}, [isFocused, policy?.employeeList]); This ensures What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N/A What alternative solutions did you explore? (Optional) |
This is handled by callstack as the initial assignment suggests. We need to make sure this is called when the page is opened/ navigated from deelinks and in narrow view too |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.45-21 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-05-22. 🎊 For reference, here are some details about the assignees on this issue:
|
@s77rt @RachCHopkins @s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
|
Coming from here
On some of the workspace feature pages, we call the
OpenPolicyFeatureX
API command additionally when the RHP modal is closed.For example:
OpenPolicyFeatureX
command was called againSimilar thing is happening on the report fields page too and possibly on some other pages too. It does not happen on all the pages so potentially the solution is quick
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @RachCHopkinsIssue Owner
Current Issue Owner: @martasudolThe text was updated successfully, but these errors were encountered: