[HOLD] User Avatar does not fall back on default when offline, and instead a blank space is shown.
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:
- Force close the app
- Turn on airplane mode
- Open the app
Expected Result:
App should load on offline mode and user avatar should be displayed
Actual Result:
App is not loading the user avatar on offline mode. A blank space is displayed.
Workaround:
Going back online fixes the issue.
Platform:
Where is this issue occurring?
- iOS
- Android
- Desktop
Version Number: 1.1.8-0
Reproducible in staging?: Yes Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
When testing this, I noticed on my device that the avatars from the LHN conversation list were also not loading
Expensify/Expensify Issue URL:
Issue reported by: @roryabraham Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1633893109079200
Triggered auto assignment to @Luke9389 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @jboniface (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Proposal:
The avatar-images are requested by the URL each time user opens new window.
We see the solution in several ways:
- No need to show user’s avatar-image and use placeholder instead. #
We can check in
Avatar.jsthe state of network connection then if not connected — to show a placeholder and it will be applied to all views. In this case is it necessary immediately after the connection appears to change the placeholder to user’s avatar-image in real time without re-opening the window?
https://github.com/Expensify/App/blob/fa7cb605574f1ddd147615eb070d828985dfc20a/src/components/Avatar.js#L50
We can modify above line as shown below, to fix this issue.
<Image source={this.props.network.isOffline ? require("../../assets/images/avatars/user.jpg") : {uri: this.props.source}} style={imageStyle}/>
https://user-images.githubusercontent.com/71173662/138506952-d0a3f986-c840-437c-8a3e-c5759e3771aa.MP4
- If it’s necessary to show avatars without a network connection, then we suggest:
As one of the solutions we see adding a new property,
base64Avatar, which will be saved local for each chat and for the main user. When the user’s avatar-image is first retrieved from the url. If there is no connection — display the backup stored in thebase64Avatarproperty. Every time the user’s avatar-image changes, the backup will also change, it will be obtained from the current avatar.
Or we can suggest using some library like react-native-fast-image
@Santhosh-Sellavel Was able to reproduce this issue on desktop too, adding to original comment

@Luke9389 do you have an opinion on the pending proposal?
Hey @developvsn, thanks for the proposal. The solution we want is for the avatar to fall back to a default avatar (like the one Chronos has). That's like solution number 1 above. I don't think we should have the require inside the ternary, but otherwise, this proposal looks OK. I'll give you the 🟢 green light 🟢 to go ahead and start a PR.
@developvsn if you haven't applied to the upwork job, can you do so? If you have applied, can you let me know who you are on UW so I can hire you? you can also message me through the job posting on UW and let me know your gh username if you'd prefer.
Hello @Luke9389 , we started the PR (branch fix-default-avatar) !
Hello @jboniface, we'll message you on upwork , we haven't applied yet, thanks !
@developvsn we noticed the PR was submitted by @RGutu. Our process for managing and paying contributors is setup so that the same account that is hired in the Github issue is the same who submits the PR. Can you use the same accounts in the future?
@mallenexpensify okay, we just wanted to submit it from our organisation account, and it didn't work, so in the future we'll use same accounts , understood.
Thanks @developvsn , it'll make our lives much easier.
For this issue, can you apply to the Upwork job here https://www.upwork.com/jobs/~01382d9aca711ad10a then confirm in a comment here once you have. Please include your first name and initial of last name so we can ensure we hire the correct person.
I'm also going to confirm in the PR that payment will be going to the user in Upwork to ensure wires don't get crossed.
Thanks!
@mallenexpensify We applied to the Upwork job. The name on upwork is: Alexandru. S.
We are placing all non-critical issues on hold while we're on a company offsite. The hold is expected to be lifted on 11/19 (but could go longer). For any PRs that are submitted before or during the hold, we will add a $250 bonus payment.
temporary hold, not overdue
I hired Alexandru @developvsn
📣 @developvsn You have been assigned to this job by @jboniface! Please apply to this job in Upwork and let us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
@Luke9389 Hi ! Can you please review or give us an update regarding Pull Request
@mallenexpensify okay, we just wanted to submit it from our organisation account, and it didn't work, so in the future we'll use same accounts , understood.
@developvsn as per your comment here, I have tested this on Staging iOS app and the issue still prevails. Therefore, we should still go ahead with trying to solve this or find out why is it it should work on production but not on staging (I only have staging on my phone right now, so I can't test production behaviour).
@mountiny @jboniface @Luke9389 We downloaded production app for 3 different IOS devices and 1 android, and we can't reproduce this bag.
IOS
https://user-images.githubusercontent.com/71173662/142903856-b9380962-20ed-46e0-97a4-65e4118a7cba.MP4
Android
https://user-images.githubusercontent.com/71173662/142903920-75ea71b4-2b7e-4530-8463-7eb59f205f6f.mp4
We also tried to do it in github source code and it's the same result:
https://user-images.githubusercontent.com/71173662/142904731-cb82d08f-1f7b-446b-b3f3-46cb0cac9d39.mp4
This is my experience on Staging. I guess we need to test more. Why would it occur only on staging but prod and dev would be fine, interesting 😅
https://user-images.githubusercontent.com/36083550/142930385-7ca83875-5a1c-476f-96c9-4823b42eafa8.MOV