-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Check if policy room is archived because of merging #14779
Conversation
@@ -7,7 +7,6 @@ import moment from 'moment'; | |||
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
@@ -70,7 +71,7 @@ let doesDomainHaveApprovedAccountant; | |||
Onyx.connect({ | |||
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
@@ -51,13 +52,14 @@ const showUserDetails = (email) => { | |||
}; | |||
|
|||
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 <[email protected]>
Reviewer Checklist
Screenshots/VideosMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
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 🚀
|
@@ -51,13 +52,14 @@ const showUserDetails = (email) => { | |||
}; | |||
|
|||
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 name
as that is what is expected.Then the other case is that Admin sees this
Fixed Issues
$ #14292
Tests
Here is admin
Message from userB
Message from userC
Message from userC
Offline tests
No specific Offline tests
QA Steps
Same as tests. @trjExpensify would help with the QA here.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component 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