[HOLD for payment 2021-09-17] No error shown on Group Creation with Chronos
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Click on FAB
- Click "New Group"
- Add Chronos as the member and click on Create Group
- No feedback/error message
Expected Result:
- Chronos shouldn't be visible in the Group list
- Or show an error when the server sends this
401 Chronos is not permitted to participate in group chats
Actual Result:
https://user-images.githubusercontent.com/3069065/128581813-a9112bc9-3360-4ed7-af85-630944398a5e.mp4
Workaround:
Don't choose Chronos while creating a new Group
Platform:
Where is this issue occurring?
- Web
- iOS
- Android
- Desktop App
- Mobile Web
Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:
Triggered auto assignment to @bfitzexpensify (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Proposal
Don't show Chronos while adding to New Group
- getNewChatOptions defined in OptionsListUtils.js is being used to get participants in New group. It has a flag to ignoreConceirgeEmails and we can extend it to ignore Chronos email too. Because concerige is allowed in the group chat the config param would look like
function getNewChatOptions( reports, personalDetails, searchValue = '', excludeConcierge, excludeChronos, betas) {
or
function getNewChatOptions( reports, personalDetails, searchValue = '', { excludeConcierge: false, excludeChronos:true }, betas) {
-
Accordingly update getOptions, where we can just add another flag, excludeChronos = false and add the following check
if (excludeChronos) { loginOptionsToExclude.push({login: CONST.EMAIL.CHRONOS}); }
-
Update references so that Chronos is not visible in the partiicpant search list.
API Error message
In addition to handling on the frontend, I feel we should also handle and show API error on the frontend.
At present there's no catch block and hence API errors are not caught.
In libs/actions/Report.js
fetchOrCreateChatReport(participants, shouldNavigate = true)
...
return API.CreateChatReport({
}).then(() => {
// Existing function
}).catch(err => {
let errorMessage =
switch(err.satatusCode) {
mesage = .....
}
return throw new Error(translate(message))
});
}
Then in NewGrouPage
fetchOrCreateChatReport(...).then(...).catch(err => {
Growl(err.message) // Error message to com here
})
Triggered auto assignment to @AndrewGable (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
@AndrewGable Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Triggered auto assignment to @MitchExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Thanks for the bug report @mananjadhav! @MitchExpensify or @deetergp any ideas on whether we should go with solution one or two? I think both proposals look good, let's just decide what we want to do in this case and then hire @mananjadhav
I've added option 2 for Split Money. I would suggest let's use that so that it is generic across.
Let's go with option 1, since it follows the precedent that excludeConcierge has already set.
@deetergp We'll have other email addresses too in this section such as [email protected]? Internally if you see the getOptions function it takes an object only with flags. We'll end up adding parameters for all non-user accounts with Option 1. What do you think?
Hmm, that's a fair point. We employ a number of service accounts like, receipts@, that could be problematic. I need to think on it a bit…
Agreed and hence we've gone ahead with
function getNewChatOptions(
reports,
personalDetails,
searchValue = '',
excludeOptions,
betas,
)
where
excludeOptions = {
excludeConcierge,
excludeChronos,
excludeReceipts
}
@AndrewGable, @MitchExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
Still discussing solution.
Why would we ever need to pass excludeChronos: false? If we don't want to exclude something, we just shouldn't pass it.
How about this, rather than having a bunch of individual if (exclude…) {} checks, we pass an array of the logins we want to exclude
excludeLogins = [
CONST.EMAIL.CONCIERGE,
CONST.EMAIL.CHRONOS,
etc…,
];
Then iterate over it in OptionsListUtils.js. Does that make sense?
I had proposed a similar solution for one of the issues earlier but it seemed we weren't sure if we would have multiple automated accounts.
Tell me one thing, are we going to have all automated accounts disabled at all places except New Chat? If yes then a single flag, say excludeAutomatedAccounts will suffice, and then in the common function OptionsListUtils we can iterate.
If we're going to have different use-cases then the above solution works aptly.
Tell me one thing, are we going to have all automated accounts disabled at all places except New Chat?
That is an interesting question! Concierge is currently a member of group chats in our old Expensify, in-app support tool, and I would assume that eventually it will be a part of group chats in NewDot. Conversely, Chronos has never been a group participant and there is nothing on the roadmap that would change that. Currently, there is no reason for anyone to chat with receipts@ in any context, but I could see allowing users to DM receipt attachments to it at some point.
The tl;dr is let's allow the ability to pass the individual accounts for now, rather than grouping all the automated accounts together.
Thanks for the detailed answer. Yeah, then it makes sense to send individual accounts.
@deetergp Are we good to take this ahead?
Ultimately, it's @AndrewGable's call, but I'm all for moving forward with the proposal that includes individual accounts.
Agreed! @MitchExpensify can you configure this via Upwork? Thanks.