You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-03-19] [$500] Members – Member invited in offline is not grayed out on Announce room members list #34671
Version Number: 1.4.26-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Navigate to the Workspace editor
Navigate to the Manage members page.
Disable the internet connection
Click on invite and enter a user address
Select the member and click on invite
Verify the member is added to the list and it's grayed out
Navigate to #announce room> Members
Expected Result:
Added member in offline should be grayed out in Announce room members list
Actual Result:
Member invited in offline mode is not grayed out on Announce room members list
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Members – Member invited in offline is not grayed out on Announce room members list[/-][+][$500] Members – Member invited in offline is not grayed out on Announce room members list[/+]on Jan 17, 2024
Please re-state the problem that we are trying to solve in this issue.
Members – Member invited in offline is not grayed out on Announce room members list
What is the root cause of that problem?
We are not adding pendingAction:, in participants data inside ReportParticipantsPage.
What changes do you think we should make in order to solve the problem?
We need to use withPolicyAndFullscreenLoading or withPolicy or we can directly subscribe to onyx for getting policyMembers and get the pendingAction boolean of a account id and then pass it to pendingAction: , here:
Then we will get the object from policyMembers for each account using participants.accountId: const pendingAction = _.get(props.policyMembers, accountId).pendingAction
Also, when creating a workspace, we don't set pending action for admin, so we need to add a pending action for admin and clear it in the successData.
We need to also update onyx for POLICY_MEMBERS when inviting/removing room members, we have the implementation for inviting/removing workspace members, we need to just do the same and the we can get policyMembers data for room policies also. In the code snippet below we can see we update onyx for POLICY_MEMBERS while inviting users to workspace.
Please re-state the problem that we are trying to solve in this issue.
Members – Member invited in offline is not grayed out on Announce room members list
What is the root cause of that problem?
if a participant is created in offline mode then there should a pendingAction
however the getAllParticipants does not return the pendingAction object of each participant ,unlike the workspace members page
What changes do you think we should make in order to solve the problem?
so in case the report is a policy report we need to check the pending action of each participant
this can done by:
Please re-state the problem that we are trying to solve in this issue.
Member invited in offline mode is not grayed out on Announce room members list
What is the root cause of that problem?
In ReportParticipantsPage, we are using visibleChatMemberAccountIDs to display participants.
When adding new members to workspace, we will add accountID of new members to visibleChatMemberAccountIDs of announce report but we don't add any sign to identify which accountIDs is pending
What alternative solutions did you explore? (Optional)
In another implementation of the above idea, we can update the data structure of visibleChatMemberAccountIDs field, currently visibleChatMemberAccountIDs is a list of accountIDs. We can update this field to include pendingAction like this
To avoid confusions before @getusha starts the review I want to mention that I already have many edits, the last edit which was made before the other proposals came was the 9th edit, and it already mentioned about getting data about members pendingAction using policyMembers, that edit came before @abzokhattab's proposal. I recently faced a issue where all the participants wasted too much time in selecting the right proposal due to edits. I'm trying improve my proposal and from now on I will post proposal updated after every edit.
changed the title [-][$500] Members – Member invited in offline is not grayed out on Announce room members list[/-][+][HOLD for payment 2024-03-19] [$500] Members – Member invited in offline is not grayed out on Announce room members list[/+]on Mar 12, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.50-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@getusha / @DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
[@getusha / @DylanDylann] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@getusha / @DylanDylann] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@getusha / @DylanDylann] Determine if we should create a regression test for this bug.
[@getusha / @DylanDylann] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
[-]Members – Member invited in offline is not grayed out on Announce room members list[/-][+][$500] Members – Member invited in offline is not grayed out on Announce room members list[/+]melvin-bot commentedon Jan 17, 2024
Job added to Upwork: https://www.upwork.com/jobs/~0115b0aaa09aebec57
melvin-bot commentedon Jan 17, 2024
Triggered auto assignment to @alexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jan 17, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (
External)Krishna2323 commentedon Jan 17, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Members – Member invited in offline is not grayed out on Announce room members list
What is the root cause of that problem?
We are not adding
pendingAction:,inparticipantsdata insideReportParticipantsPage.What changes do you think we should make in order to solve the problem?
We need to use
withPolicyAndFullscreenLoadingorwithPolicyor we can directly subscribe to onyx for gettingpolicyMembersand get the pendingAction boolean of a account id and then pass it topendingAction:, here:App/src/pages/ReportParticipantsPage.js
Lines 87 to 92 in 7dfbddc
We can also add a check for finding if the report is a policy or not.
We will subscribe to
policyMembersusing:Then we will get the object from
policyMembersfor each account usingparticipants.accountId:const pendingAction = _.get(props.policyMembers, accountId).pendingActionAlso, when creating a workspace, we don't set pending action for
admin, so we need to add a pending action for admin and clear it in thesuccessData.App/src/libs/actions/Policy.ts
Lines 1189 to 1198 in 4b7b8f2
App/src/libs/actions/Policy.ts
Lines 1249 to 1258 in 4b7b8f2
App/src/libs/actions/Policy.ts
Line 1316 in 4b7b8f2
Object to clear pendingAction in successData:
For room invitation:
We need to also update onyx for
POLICY_MEMBERSwhen inviting/removing room members, we have the implementation for inviting/removing workspace members, we need to just do the same and the we can getpolicyMembersdata for room policies also. In the code snippet below we can see we update onyx forPOLICY_MEMBERSwhile inviting users to workspace.Details
App/src/libs/actions/Policy.ts
Lines 601 to 687 in 6cfdd6f
We also need to add utilities like below:
App/src/libs/actions/Policy.ts
Lines 1052 to 1069 in 6cfdd6f
We might need to add some more changes to sync with workspace invite/remove flow but that can be discussed during the PR.
Result
room_members_not_grayed_out.mp4
abzokhattab commentedon Jan 17, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Members – Member invited in offline is not grayed out on Announce room members list
What is the root cause of that problem?
if a participant is created in offline mode then there should a pendingAction
however the getAllParticipants does not return the
pendingActionobject of each participant ,unlike the workspace members pageWhat changes do you think we should make in order to solve the problem?
so in case the report is a policy report we need to check the pending action of each participant
this can done by:
First load the policy members using
withOynx:Then inside the
ReportParticipantsPagefunction, we need to add a new attributepolicyMembers:Then we need to add the pending action to the returned object of each participant
return { alternateText: userLogin, displayName, + pendingAction, accountID: userPersonalDetail.accountID, icons: [ { id: accountID, source: UserUtils.getAvatar(userPersonalDetail.avatar, accountID), name: userLogin, type: CONST.ICON_TYPE_AVATAR, }, ], keyForList: `${index}-${userLogin}`, login: userLogin, text: displayName, tooltipText: userLogin, participantsList: [{accountID, displayName}], };Result
also, I refactored the
isDeletedlogic and added to thegetAllParticipantsfunction so that we don't have to loop over the participants list twice.you can check all the changes in the following test branch:
Test Branch
DylanDylann commentedon Jan 18, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Member invited in offline mode is not grayed out on Announce room members list
What is the root cause of that problem?
In
ReportParticipantsPage, we are usingvisibleChatMemberAccountIDsto display participants.When adding new members to workspace, we will add accountID of new members to
visibleChatMemberAccountIDsof announce report but we don't add any sign to identify whichaccountIDsis pendingApp/src/libs/actions/Policy.ts
Line 632 in 4da7fda
App/src/libs/actions/Policy.ts
Line 322 in 4da7fda
What changes do you think we should make in order to solve the problem?
We can introduce a new field called
pendingVisibleChatMemberAccountIDswhen adding new member to the workspaceApp/src/libs/actions/Policy.ts
Line 322 in 4da7fda
we will add
and in successData and failureData we will reset
We also update the same thing when removing member from workspace
And then in
ReportParticipantsPage, we will add pendingAction field based on pendingVisibleChatMemberAccountIDsWhat alternative solutions did you explore? (Optional)
In another implementation of the above idea, we can update the data structure of
visibleChatMemberAccountIDsfield, currentlyvisibleChatMemberAccountIDsis a list of accountIDs. We can update this field to include pendingAction like thisWith this approach, we have a global solution to handle bugs that relate to pendingAction of member in reports
alexpensify commentedon Jan 19, 2024
@getusha - can we get your feedback here? Thanks!
Krishna2323 commentedon Jan 20, 2024
To avoid confusions before @getusha starts the review I want to mention that I already have many edits, the last edit which was made before the other proposals came was the 9th edit, and it already mentioned about getting data about members
pendingActionusingpolicyMembers, that edit came before @abzokhattab's proposal. I recently faced a issue where all the participants wasted too much time in selecting the right proposal due to edits. I'm trying improve my proposal and from now on I will postproposal updatedafter every edit.58 remaining items
alexpensify commentedon Feb 20, 2024
This PR looks like it's still moving forward!
alexpensify commentedon Feb 27, 2024
Weekly Update: The PR is still under review
alexpensify commentedon Mar 5, 2024
Weekly Update: The recent PR comments were addressed yesterday.
[-][$500] Members – Member invited in offline is not grayed out on Announce room members list[/-][+][HOLD for payment 2024-03-19] [$500] Members – Member invited in offline is not grayed out on Announce room members list[/+]melvin-bot commentedon Mar 12, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Mar 12, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.50-5 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 2024-03-19. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Mar 12, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
alexpensify commentedon Mar 19, 2024
Here is the payment summary:
Upwork Job: https://www.upwork.com/jobs/~0115b0aaa09aebec57
Extra Notes regarding payment: Everyone has been paid via Upwork.