-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Check if policy room is archived because of merging #14779
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
Conversation
| import * as CollectionUtils from './CollectionUtils'; | ||
| import CONST from '../CONST'; | ||
| import ONYXKEYS from '../ONYXKEYS'; | ||
| import * as ReportUtils from './ReportUtils'; |
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.
This is to resolve a cyclic dependency between these two utility libraries
| key: ONYXKEYS.ACCOUNT, | ||
| waitForCollectionCallback: true, | ||
| callback: val => doesDomainHaveApprovedAccountant = val.doesDomainHaveApprovedAccountant, | ||
| callback: val => doesDomainHaveApprovedAccountant = val.doesDomainHaveApprovedAccountant || false, |
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.
I have been running to this value not being defined locally and causing the app not to load so casting this to false in case val is not defined helped. Should be no harm in this change
| }; | ||
|
|
||
| const ReportActionItemSingle = (props) => { | ||
| const actorEmail = props.action.actorEmail.replace(CONST.REGEX.MERGED_ACCOUNT_PREFIX, ""); |
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 merged accounts will have MERGED_<number>@ prefix on the actorEmail so lets remove that so we can load the details correctly
|
@thesahindia @chiragsalian One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@thesahindia i am not sure if this flow is easy to test for you, maybe not. At the moment its on hold too. |
Co-authored-by: Chirag Chandrakant Salian <chirag@expensify.com>
Reviewer Checklist
Screenshots/VideosMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
chiragsalian
left a comment
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.
|
@chiragsalian thanks for catching that, that was a mistake in the test steps indeed. Thanks for review and testing! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.2.68-0 🚀
|
|
Quick update: Actively working on the internalQA of this at the moment. |
|
I executed this with two scenarios:
Scenario #1 is what's laid out in the OP (though I merged userB into userC). The only bug I caught there was that the For good measure, I then deleted the workspace and the archiveReason updated for all to note that the workspace has been deleted. 👍 Scenario #2, I executed this full test script for workspace chats. I ran into a couple of additional bugs in this case:
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.2.68-0 🚀
|
| }; | ||
|
|
||
| const ReportActionItemSingle = (props) => { | ||
| const actorEmail = props.action.actorEmail.replace(CONST.REGEX.MERGED_ACCOUNT_PREFIX, ''); |
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.
Not directly related, but we should have created a utility function that did this replacement. Later on, at some places we forgot to do this replacement which caused #32127.






Details
Finding out if the archive workspace is coming from merged account is not easy. The archived workspace of the old account (by old its meant an account which got merged into the current "new" account) is still associated with the old accountID, hence the normal condition to figure out the name of the workspace chat is not enough since the new account does not technically "own" the report, its just shared with it.
Hence we need to add further checks, we will check if the room is archived and if the last report action in that chat report is a closed report action with MERGED archiveReason. This ensures that for a member of the workspace the chat report is correctly names
Workspace nameas that is what is expected.Then the other case is that Admin sees this
Fixed Issues
$ #14292
Tests
Here is adminMessage from userBMessage from userCMessage from userCOffline tests
No specific Offline tests
QA Steps
Same as tests. @trjExpensify would help with the QA here.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
As an admin:

As a new account
Mobile Web - Chrome
As admin

As member


Mobile Web - Safari
As an admin
As a member


Desktop
As an admin

As a member

iOS
There are some native iOS build issues which prevent me from testing. This change is platform agnostic however so we can continue without these
Android
There are some native build issues which prevent me from testing. This change is platform agnostic however so we can continue without these