-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[$2000] Chat - App crashed tapping profile icon #8545
Comments
Triggered auto assignment to @thienlnam ( |
Interesting, looks like it is only broken in that flow and not when you log into an existing account. Looks like it can be an external fix though |
Triggered auto assignment to @kadiealexander ( |
Posted to Upwork: |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Current assignee @thienlnam is eligible for the Exported assigner, not assigning anyone new. |
@kadiealexander Let's double this one. cc: @thienlnam |
Good call Santhosh, done! Get those proposals in team! |
Still waiting for proposals here! |
Let's double this one, do you agree? @thienlnam |
ProposalCauseWhen user first time login chat list not yet created. personalDetailsList request returned empty array. Avatar does not appear due to lack of user information. Clicking on the empty avatar also gives an error because there is no user (Concierge) information. SolutionWe can wait for the Concierge report to be created and then get the PersonalDetails for first logins. App/src/libs/actions/Report.js Lines 1000 to 1029 in f174c32
should change like this Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, true);
let firstLogin = false;
return API.Get({
returnValueList: 'chatList',
})
.then((response) => {
if (response.jsonCode !== 200) {
return;
}
// The cast here is necessary as Get rvl='chatList' may return an int or Array
const reportIDs = _.filter(String(response.chatList).split(','), _.identity);
// Get all the chat reports if they have any, otherwise create one with concierge
if (reportIDs.length > 0) {
return fetchChatReportsByIDs(reportIDs);
}
firstLogin = true;
return fetchOrCreateChatReport([currentUserEmail, CONST.EMAIL.CONCIERGE], false);
.then((returnedReports) => {
Onyx.set(ONYXKEYS.INITIAL_REPORT_DATA_LOADED, true);
Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false);
// If at this point the user still doesn't have a Concierge report, create it for them.
// This means they were a participant in reports before their account was created (e.g. default rooms)
const hasConciergeChat = _.some(returnedReports, report => ReportUtils.isConciergeChatReport(report));
if (!hasConciergeChat) {
fetchOrCreateChatReport([currentUserEmail, CONST.EMAIL.CONCIERGE], false)
.then((returnedReportsSecond) => {
const hasConciergeChatSecond = _.some(returnedReportsSecond, report => ReportUtils.isConciergeChatReport(report));
if (hasConciergeChatSecond) {
PersonalDetails.fetchPersonalDetails();
}
});
} else if (firstLogin) {
PersonalDetails.fetchPersonalDetails();
} video: web-first-login-2022-05-01.mp4 |
@metehanozyurt Thanks for the proposal! But I am not 100% on board with it. I think the root cause is different. Reason: Click -> FAB -> New Chat. Personal details should be fetched automatically, we should look for why it's not fetched automatically. So I think we are missing something here. |
You are right, I have observed this situation now. Thank you for the reply 🙏 . |
Updated proposal:
function getPersonalDetailsForEmail(email) {
API.PersonalDetails_GetForEmails({emailList: email})
.then((data) => {
const details = _.pick(data, email);
Onyx.merge(ONYXKEYS.PERSONAL_DETAILS, formatPersonalDetails(details));
});
}
const hasConciergeDetails = _.some(allPersonalDetails, person => person.login === CONST.EMAIL.CONCIERGE);
if (!hasConciergeDetails) {
getPersonalDetailsForEmail(CONST.EMAIL.CONCIERGE);
}
const DetailsPage = (props) => {
const details = props.personalDetails[props.route.params.login];
if (!details) {
PersonalDetails.getPersonalDetailsForEmail(props.route.params.login);
return <FullScreenLoadingIndicator />;
} Result: cinnamon-20220518-4.mp4 |
@thienlnam Just one concern if needed we should refactor if (!details) {
PersonalDetails.getPersonalDetailsForEmail(props.route.params.login);
return <FullScreenLoadingIndicator />;
} |
Ok, I'll test this and apply changes if needed |
@thienlnam any thoughts on the above? |
Just came back from OOO, I understand that refetching the personal details will fix it from crashing, but why do those personal details not exist in the first place when we're fetching those person details of a report? That seems like the root cause we should try to resolve |
For For another case after creating a new chat when immediately pressing the header, personalDetails for that report is being fetched. |
This makes sense and is okay
Can we just wait until personalDetails is finished loaded? We're just grabbing it again here right? |
In this case we're just waiting for the getFromReportParticipants to finish, so yes, we actually don't need to make a network reqest on the third step of my prorosal. It would just need to show loading indicator until network request is finished. const DetailsPage = (props) => {
const details = props.personalDetails[props.route.params.login];
if (!details) {
return <FullScreenLoadingIndicator />;
} |
@eVoloshchak Thank you, can you show another video with that updated proposal? |
@thienlnam, sure cinnamon-20220526-2.mp4 |
Awesome thanks - 👍 to the updated proposal |
📣 @eVoloshchak You have been assigned to this job by @thienlnam! |
Offers sent on upwork to @Santhosh-Sellavel and @eVoloshchak :) |
@eVoloshchak Any update here? |
@eVoloshchak any update? |
Sorry for the delay, expect a PR in 28 hours |
@thienlnam I'm going OOO, I request to add a hold on this issue until I am back or un-assign me and add a new C+ here. Thanks! cc: @kadiealexander |
Thanks Santhosh! @eVoloshchak could you please let us know about the PR? |
Encountered an issue on native platforms, now all resolved, PR is up |
Left a note on the linked PR, but I think this should be made |
@marcaaron could you please lay out the steps we need to proceed with that? Should we just close the current PR and pay @eVoloshchak and @Santhosh-Sellavel now? |
Let's pay out the amounts to @eVoloshchak and @Santhosh-Sellavel. We will be taking this internal and will be re-worked as we work on our API refactors |
Awesome, thanks @thienlnam! I've paid everyone. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
App is not crashed after click on Concierge icon and it should display the details
Actual Result:
App is crashed after click on Concierge icon
Workaround:
Unknown
Platform:
Where is this issue occurring?
Version Number: 1.1.52.0
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Bug5523829_Recording__179.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause
Slack conversation:
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: