Closed kavimuru closed 1 year ago
Triggered auto assignment to @jliexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are β
)Not reproducible on latest main
Also just tested in v1.3.38-3 and I don't see this behaviour anymore:
https://github.com/Expensify/App/assets/30815269/e30c478e-07c7-40fe-94db-c83dbee199ae
Actually, I take that back - I notice that in my last video, the avatar initially was a default one, before switching to mine.
So I tested on another random convo and I can now reproduce:
https://github.com/Expensify/App/assets/30815269/e4bf1340-ccab-4e46-808f-28369e4a9dfe
Job added to Upwork: https://www.upwork.com/jobs/~01a250dc528d0d38dd
Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External
)
LHN header avatar disappears for a brief moment when refreshing page
AvatarWithIndicator
is wrapped with withOnyx
HOC.
There's Onyx data loading time before render.
As only indicator uses onyx data, we can render Avatar always and lazy-load only indicator.
Implementation detail:
separate AvatarWithIndicator
component into 2:
Indicator
- render only indicator view conditionally based on Onyx dataAvatarWithIndicator
- remove Onyx part and replace this line with <Indicator />
https://github.com/Expensify/App/blob/60f48175c9e3342ef192d878218820e5ed5a76cd/src/components/AvatarWithIndicator.js#L106https://github.com/Expensify/App/assets/108292595/a2ca6962-f108-4432-a37b-f0ad4f7ca82e
https://github.com/Expensify/App/assets/108292595/faf55940-4733-492c-bd71-acc2f7812cce
LHN header avatar disappears for a brief moment when refreshing page
There is a slight delay when loading the asset image.
I discovered that this issue is exclusive to https://new.expensify.com/ and does not occur locally. So I've implemented caching for the avatar image. React Native inherently supports this functionality.
Hi @rushatgabhane , we've got a couple of proposals coming in - could you review?
Proposal Please re-state the problem that we are trying to solve in this issue. LHN header avatar disappears for a brief moment when refreshing page.
What is the root cause of that problem? I think the main reason, for it is whenever a component mounts, it triggers lifecycle methods, and in this case, we are fetching data from Onyx (a state management library used in your application). If the Avatar's source is fetched asynchronously, this would lead to a delay in rendering the avatar image, causing it to disappear during the page refresh.
What changes do you think we should make in order to solve the problem? To solve this issue, what I think we can do is add a placeholder image and then when we reload the actual avatar get displayed.
import PlaceholderImage from './path-to-placeholder-image'; // Import placeholder image
function AvatarWithIndicator(props) {
// Use placeholder image if the source URL is not yet available
const avatarSource = UserUtils.getSmallSizeAvatar(props.source) || PlaceholderImage;
return (
<Tooltip text={props.tooltipText}>
<View style={[styles.sidebarAvatar]}>
<Avatar source={avatarSource} />
{(shouldShowErrorIndicator || shouldShowInfoIndicator) && <View style={StyleSheet.flatten(indicatorStyles)} />}
</View>
</Tooltip>
);
}
What alternative solutions did you explore? (Optional)
@situchan sounds good! what happens when even the Avatar isn't available? eg: after a fresh logout and sign in
@situchan sounds good! what happens when even the Avatar isn't available? eg: after a fresh logout and sign in
It won't be affected by my change, same as production. This issue happens only when app refresh.
https://github.com/Expensify/App/assets/108292595/0a9f4bab-8e50-4a34-9487-4ab37e041485
hey! I am new here! Can someone tell me if my Proposal is fine or not?
thanks for confirming @situchan https://github.com/Expensify/App/issues/22514#issuecomment-1628233400 c+ reviewed π π π
Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@AnshuAgarwal24 sorry, @situchan posted a good proposal before you
Sounds good to me as well, let's go with @situchan's proposal.
π£ @rushatgabhane Please request via NewDot manual requests for the Reviewer role ($1000)
π£ @situchan You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing π
π£ @situchan We're missing your Upwork ID to automatically send you an offer for the Reporter role. Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!
π― β‘οΈ Woah @rushatgabhane / @situchan, great job pushing this forwards! β‘οΈ
The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus π
On to the next one π
@situchan just invited you: $250 + $1500 @rushatgabhane you'll be paid via New.Dot, please request with Anu!
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.42-26 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-07-26. :confetti_ball:
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
Bump @rushatgabhane to complete the checklist.
Also, this qualifies for a bonus.
Bump @rushatgabhane to complete the list before payment is released:
Bump @rushatgabhane to complete the list before payment
The PR that introduced the bug has been identified. Link to the PR: Too small edge case imo π
And we had AvatarWithIndicator
since the beginning of time :)
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N.A.
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: No
Determine if we should create a regression test for this bug. - No
If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again - N.A.
Nice, thanks you @rushatgabhane - will sort out payment today.
Paid and job closed - cheers!
Reviewed details for @rushatgabhane. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.
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:
Avatar will always remain/show
Actual Result:
Avatar doesn't show until page is fully loaded - there is a ~1 second delay.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.38-2 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/43996225/9caaa8af-3497-4aa8-85e9-3c7e6b103c6e
https://github.com/Expensify/App/assets/43996225/0caf7461-034d-4c06-bbf2-a8dd8462d8b3
Expensify/Expensify Issue URL: Issue reported by: @situchan Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688843824514419
View all open jobs on GitHub
Upwork Automation - Do Not Edit