App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD] User Avatar does not fall back on default when offline, and instead a blank space is shown.

Open isagoico opened this issue 5 years ago • 33 comments

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:

  1. Force close the app
  2. Turn on airplane mode
  3. 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

View all open jobs on GitHub

view this job on upwork

isagoico avatar Oct 21 '21 15:10 isagoico

Triggered auto assignment to @Luke9389 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar Oct 21 '21 15:10 MelvinBot

Triggered auto assignment to @jboniface (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

MelvinBot avatar Oct 21 '21 17:10 MelvinBot

Proposal:

The avatar-images are requested by the URL each time user opens new window.

We see the solution in several ways:

  1. No need to show user’s avatar-image and use placeholder instead. # We can check in Avatar.js the 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

  1. 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 the base64Avatar property. 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

developvsn avatar Oct 22 '21 18:10 developvsn

@Santhosh-Sellavel Was able to reproduce this issue on desktop too, adding to original comment image

isagoico avatar Oct 26 '21 03:10 isagoico

@Luke9389 do you have an opinion on the pending proposal?

jboniface avatar Nov 01 '21 15:11 jboniface

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.

Luke9389 avatar Nov 01 '21 18:11 Luke9389

@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.

jboniface avatar Nov 01 '21 18:11 jboniface

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 avatar Nov 04 '21 16:11 developvsn

@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 avatar Nov 04 '21 17:11 mallenexpensify

@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 avatar Nov 04 '21 17:11 developvsn

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 avatar Nov 04 '21 17:11 mallenexpensify

@mallenexpensify We applied to the Upwork job. The name on upwork is: Alexandru. S.

developvsn avatar Nov 07 '21 13:11 developvsn

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.

mallenexpensify avatar Nov 08 '21 17:11 mallenexpensify

temporary hold, not overdue

jboniface avatar Nov 09 '21 19:11 jboniface

I hired Alexandru @developvsn

jboniface avatar Nov 18 '21 23:11 jboniface

📣 @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 📖

MelvinBot avatar Nov 18 '21 23:11 MelvinBot

@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 avatar Nov 22 '21 12:11 developvsn

@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 avatar Nov 22 '21 16:11 mountiny

@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

developvsn avatar Nov 22 '21 17:11 developvsn

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

mountiny avatar Nov 22 '21 20:11 mountiny