Open lanitochka17 opened 2 months ago
Triggered auto assignment to @Christinadobrzyn (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@Christinadobrzyn FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
We think that this bug might be related to #vip-vsp
I can reproduce based on the steps in the OP - I think this can be external
Job added to Upwork: https://www.upwork.com/jobs/~01897ff6965422a788
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External
)
Avatars of users do not load, fallback avatars are displayed instead Avatars do not load even after a few minutes waiting time
In a public room there're a lot of actors because a lot of people send messages there.
When the report is initially loaded, it will only load a subset of the latest report actions, along with the personal details for the actors of those report actions.
When the user scrolls up, older report actions are loaded by GetOlderActions
, but the personalDetails of the actors of those older actions are still lacking.
So there's no user avatar to show and there'll be the disabled cursor from this line https://github.com/Expensify/App/blob/65db65069390cdd9fd386e087b6d8eed94ee22b0/src/pages/home/report/ReportActionItemSingle.tsx#L172
When we try to open the profile of a user from deep link, and that profile doesn't exist in personal details, we'll call openPublicProfilePage to fetch more info on those users. Likewise for calling openReport
when navigating to a report route that doesn't exist in Onyx data.
So for this case of personal details missing from Onyx
(note: only if it doesn't exist in Onyx, if it's an isOptimisticPersonalDetail
, there will be no fetching), if the case is detected, we should also call an endpoint to fetch data on the users. We can use openPublicProfilePage
.
function isPersonalDetailAvailable(accountID: number): boolean {
return !!allPersonalDetails?.[accountID];
}
useEffect(() => {
if (!actorAccountID || ReportUtils.isPersonalDetailAvailable(actorAccountID)) {
return;
}
PersonalDetailsActions.openPublicProfilePage(actorAccountID);
}, [actorAccountID]);
(This can be made a useFetchPersonalDetailIfNotAvailable
hook or a regular fetchPersonalDetailIfNotAvailable
JS function, for reuse in similar page)
Also, if a personal detail is being loading (it will have isLoading: true
in PERSONAL_DETAILS_METADATA
), we will not load it, this can be checked in the useFetchPersonalDetailIfNotAvailable
hook/function or in openPublicProfilePage
More ideally, if there's a back-end endpoints that allow fetching multiple public profile at once, something like openPublicProfiles
, we can batch the accountIds
that are missing personal details (for instance in a 3 seconds window) and fetch them in 1 API call.
Working well after fixing: https://github.com/Expensify/App/assets/170341821/1c54442a-f799-40eb-b4f4-cb4eff429edd
Avatars of users do not load when an anonymous (anon) user scrolls up in a public room with a long chat history. Instead, fallback avatars are displayed and remain even after waiting for a few minutes.
The root cause of this problem is due to issues with loading user avatars for anonymous users when fetching older messages in a chat room. This could be caused by:
To address this issue, we should:
Investigate Network Requests:
useEffect(() => {
if (isAnonUser && isFetchingOlderMessages) {
fetchUserAvatars();
}
}, [isAnonUser, isFetchingOlderMessages]);
Adjust Caching Mechanisms:
if (cache.hasAvatar(userId)) {
displayAvatar(cache.getAvatar(userId));
} else {
fetchAvatar(userId)
.then(avatar => {
cache.setAvatar(userId, avatar);
displayAvatar(avatar);
})
.catch(() => {
displayFallbackAvatar();
});
}
Ensure Proper Permissions:
if (isAnonUser) {
ensureAvatarPermissions(userId);
}
Update Fallback Logic:
if (!avatarLoaded) {
displayLoadingIndicator();
fetchAvatar(userId)
.then(avatar => {
displayAvatar(avatar);
})
.catch(() => {
displayFallbackAvatar();
});
}
Triggered auto assignment to @kadiealexander (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Just a heads up - I'm going to be ooo until June 24th so going to assign a teammate to watch this while I'm away
@kadiealexander we are collecting proposals
@sobitneupane would you be able to review the proposals we have?
Thanks for your proposal @truph01
Overall your proposal looks good to me. But I am concerned about the performance as we will be making api request for each ReportActionItem
without personal details. Will it cause any impact on performance?
Will it cause any impact on performance?
@sobitneupane From my testing, I don't see any performance impact.
There likely won't be performance issues because:
isLoading
, we won't call)openPublicProfilePage
API is fast and the API calls will be sequentialTriggered auto assignment to @cristipaval, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
I'm not happy about calling an API for each missing personal detail. We should fix the backend and make it return the personal details properly when loading a new batch of report actions with the GetOlderActions
command. A new API command just for fetching a batch of missing personal details might be against our 1:1:1 pattern, which requires the App to make one single API call for a user action. Scroll Up user action should trigger the GetOlderActions
command only.
I made this one Internal
for now. Next week, I'll investigate the implementation of the GetOlderActions
command and come back to this issue.
@cristipaval @sobitneupane @Christinadobrzyn @kadiealexander this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
This is just an update for Melvbot. @cristipaval, are you going to take a peek at this when you have the bandwidth? Let us know if you'd like us to try to find another volunteer!
I'm afraid I won't be able to take care of this one this week. I have my plate full and am also assigned to the API monitoring this week.
Sounds good @cristipaval! I will add a hot pick label to this to see if we can get a volunteer
still looking for a volunteer
still looking for a volunteer!
Nothing yet, looking for a volunteer. I'll retest this tomorrow to see if anything has changed.
@cristipaval do you think you'd be able to work on this or should I reach out in the VSB channel for a volunteer?
unfortunately I'm not able, I need to also hand over some work from my plate given that I am preparing for a long leave
No worries! I asked in the VSB room if someone can grab this - https://expensify.slack.com/archives/C066HJM2CAZ/p1721930317057559
no takers yet, we'll waiting for a volunteer
no takers - I think this VSB is on hold, I'm going to move this out to weekly while we wait for a volunteer.
no volunteers but VSB is still on hold. Added a HOLD to the title and moving this to monthly.
no takers yet, I'll retest when I'm back from ooo on 9/10
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.81-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4610474 Email or phone of affected tester (no customers): Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
Avatars of users should load along with the chat history
Actual Result:
Avatars of users do not load, fallback avatars are displayed instead Avatars do not load even after a few minutes waiting time
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/5d548520-ec77-4650-9806-d870a6778ccc
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @Christinadobrzyn