hippware / rn-chat

MIT License
5 stars 0 forks source link

Missing Avatar #2511

Closed mstidham closed 6 years ago

mstidham commented 6 years ago

Missing Avatar

QA TEMPLATE Input
Device Type: iPhone 7 Plus
iOS: 11.3.1
tr Version: 2.6.8
Environment Production
Codepush:
Internet Connection Type: WiFi
Users affected? Tara
User handle: @tara
Bypass handle?:
Location access type? Always
Does this issue occur on other environments? Not sure
Time issue occurred (UTC)

Observed Result:

User @tara shows only a grey asset for @miranda's avatar. I have verified that other users do see the actual avatar. I have also noticed several grey assets for avatars in my friends list.

Expected Result:

User @tara should see @miranda's avatar.

Steps to reproduce:

  1. Scroll through friends list.
  2. Grey assets for avatars within the list.
  3. Related Screenshots/Video Links:


    Example of the grey asset: image

bengtan commented 6 years ago

I have verified that other users do see the actual avatar.

This suggests that the behaviour is client-specific and client-side.

A hunch is that, when a client is unable to download an image, it doesn't retry so it gets 'stuck' at a grey asset.

@mstidham:

Can you try to reproduce this behaviour ...

I have also noticed several grey assets for avatars in my friends list.

... on Staging (using the same app version)?

I'm curious to see whether it also exists on Staging.

mstidham commented 6 years ago

Staging Version 2.6.8 - I see the grey asset on several users.

image

aksonov commented 6 years ago

@mstidham Please reproduce with bypass account on Staging

mstidham commented 6 years ago

126-1165 @msbypass

If you do a search in friends screen any bypass account will see the grey assets.

mstidham commented 6 years ago

I'm no longer seeing grey assets on Staging Version 3.3.0 but now blank/white avatar.

image

bengtan commented 6 years ago

I tried to reproduce this with 3.3.0 and (latest as of writing) 3.3.4.

I wasn't able to reproduce the grey assets described in the OP but I did see a blank/white avatar for one account at-becky1. It seems to be account-specific.

I'll try to track it down.

bengtan commented 6 years ago

There have been two symptoms mentioned in this ticket so far.

  1. 'grey assets' as described in the OP
  2. 'blank/white avatar' as described in the comment which is two comments above.

I don't know whether 1 and 2 are the same thing, but it seems like 1 has stopped happening so we only have to deal with 2.

I investigated 2 ('blank/white avatar').

It turns out that the app uses algolia user search to retrieve user details and the algolia search index has incorrect or outdated values for the avatar field of some users. When the app tries to retrieve these avatars, it runs into 'File not found' errors, and doesn't try to render the avatars (because it can't). Hence, the avatars are unrendered ie. blank or white.

I've logged this server side discrepancy at hippware/wocky#1839.

The fix is to correct the incorrect values at the server side.

However, algolia search is deprecated. The client should move to the replacement graphql-based user search instead. I've spun out a ticket: #2766.

So ... I don't think any action is needed for symptom 2 of this ticket. It's caused by a server side discrepancy, but the longer-term fix is to stop using algolia search and do #2766.

I'm going to leave this ticket around for a few days for others to give comments, if any, then I'm going to close it.

bengtan commented 6 years ago

2766 should indirectly fix this issue. #2766 has been deployed so let's revisit and test this.

Moving to 'Ready for QA'.

mstidham commented 6 years ago

I still see blank/white avatars on Staging Version: 3.4.1 for some users. Screenshot below is example of a few.

image

thescurry commented 6 years ago

Hey guys... this particular problem (I feel) has plagued us for long time (long before this particular ticket came to be). How do we finally resolve this? Do we need some sort of automated retry if the client tries to download the avatar asset and for some reason cannot? It seems as if the client can't get this data immediately, it never tries again (resulting in a white/grey blank. Is this something that a server-side caching layer would help resolve (maybe the data isn't served fast enough)? Let's try and get to the root of why we have so many issues with profile avatars/images getting displayed correctly on the client.

thescurry commented 6 years ago

I can also reproduce what Miranda is seeing, many white blanks if I do a friends search. I'm not sure if this means there is no image asset on the server or if it (for whatever reason) just didn't make it to the client (in time)?

bengtan commented 6 years ago

The symptom described by this ticket can result from different causes. Any unexpected error whilst trying to download the profile's avatar thumbnail can cause it.

Switching from algolia fixed the first cause. There was one account (becky1) which always showed a blank avatar on version 3.4.0 or earlier because the data from algolia was out of date. This is fixed in 3.4.1. becky1 no longer has a blank avatar.

For the latest screenshots, (my hypothesis is) there are some (old) users which have, in the DB, a blank avatar field:

aksonova bengtan bob carol kyu lgbtq_la robert tinafey

This is tripping up the client. (Most users have NULL for avatar.) I'm calling this the second cause.

This (if confirmed) explains the latest screenshots ... except for the accounts camper and dianalee. But in my testing so far, I can't reproduce for these two accounts. I can see their avatar images. So there may be a third cause.

But I'll work on the second cause first.

bengtan commented 6 years ago

@thescurry, @mstidham:

Please try codepush '3.4.2 + 2511 attempted fix 2' (StagingBeng).

However ... the codepush will only affect account profiles which are newly loaded from the server. It won't fix accounts which are already cached on your local phone (I think).

So ... I suggest the following:

  1. Update to the codepush on your existing app and test.
  2. If error still persists, clear cache and test.
  3. If error still persists, uninstall the app. Install the app. Immediately install the codepush (without searching for any users yet). Finally, search for users and test.

Let me know how you go. In particular, if it gets fixed (at 1 or 2), I'd like to know where ... because it will help me determine whether we need to do anything special (like clear cache on TestFlight upgrade) to remove incorrect account profiles cached on the phone.

If error still persists after 3, I'll investigate a possible third cause of the same symptom.

mstidham commented 6 years ago

Staging 3.4.2 + Codepush 2511 attempted fix 2

  1. Avatar was still blank/white.
  2. Cleared cache and then the menu button would not pull up the menu. Kill/reload still gave me blank/white avatars
  3. Worked perfectly, I do not have any blank/white avatars.
bengtan commented 6 years ago

Okay, so the fix works for newly fetched user accounts but doesn't fix accounts already stored/cached on the phone. One way to fix that is to clear locally stored data (#2855) but I'm not sure if this one ticket is sufficient to justify doing #2855.

mstidham commented 6 years ago

I'm still experiencing missing avatar within the Friends List on Prod Version: 3.5.0.

image

thescurry commented 6 years ago

@bengtan did this fix make it into today's staging/prod release? We can't tell.

bengtan commented 6 years ago

https://hippware.slack.com/archives/C2V6L53TQ/p1538099071000100?thread_ts=1538088181.000100&cid=C2V6L53TQ

Yes, #2511 was deployed to Staging and Prod client as of 3.5.0.

This may be another cause of the same symptom. I'll look at it later.

bengtan commented 6 years ago

When I view those two users arantzazan and explore_la (on Prod) by searching for 'ara' and 'exp' respectively in the user search box, I see avatars for both of them. When I click through to their user profile, their avatars appear as expected.

I did note that their avatars (in the user search results list) took a second or two to appear.

So I think (hope?) this is just a caching or network issue.

A sledgehammer approach would be to uninstall and reinstall and try again, but I'm not quite decided to ask @mstidham to do that yet.

bengtan commented 6 years ago

I tried some more to reproduce the latest symptom on Prod and was unsuccessful.

For each of the following, I tested by searching for the users arantzazan and explore_la using the user search box. Sometimes I also clicked through to the user profile.

So ... I dunno. I dunno why it's working for me and not working for miranda.

mstidham commented 6 years ago

I have done clean installs on Staging and Prod (multiple times). These are my results:

Staging 3.5.0 - I scroll through my friends list and 9 users are missing (blank/white) avatars. Production 3.5.0 - I scroll through my friends list and users arantzazan & explore_la now have avatars. The only remaining blank user is John Wie (@jwie86)

Also noting that account tinyrobot on Prod 3.5.0 also has a blank avatar for John Wie (@jwie86)

bengtan commented 6 years ago

I scroll through my friends list and 9 users are missing (blank/white) avatars.

Which are the 9 on Staging please?

mstidham commented 6 years ago

@bengtan I have all avatars on Staging 3.6.1, Prod 3.6.1 I’m missing the following: arantzazan ashlyn explore_la jwie86 sam63 ThereNBackAgain

Re-installed Staging 3.5.0 and have all avatars currently so I’m not sure who the 9 missing were.

bengtan commented 6 years ago

arantzazan ashlyn explore_la jwie86 sam63 ThereNBackAgain

On Prod, I can see avatars for all those accounts except for jwie86.

jwie86 is a special case. The file that the DB says is stored in AWS S3 ... isn't in S3. So there was some sort of glitch and the server side data is inconsistent for that account, but only for that account.

For the other accounts on Prod, they're working fine for me.

TL;DR: I can't reproduce (the latest instance of) this issue anymore.

thescurry commented 6 years ago

@bengtan is this a case of the client not trying to re-download the avatar when it can't access a locally cached/stored version? If so... shouldn't the client have some logic like that?

bengtan commented 6 years ago

Is this a case of the client not trying to re-download the avatar when it can't access a locally cached/stored version?

I don't think so but I can't be entirely sure.

For the previous causes of this symptom, it has been easily reproducible (for me) and so I could observe and diagnose it.

For the latest set of symptoms (Prod: arantzazan,ashlyn,explore_la,sam63,ThereNBackAgain), I can't reproduce it. So probably, it's a different cause, and I can't diagnose it until I can observe it.

Just wondering, can anyone else reproduce this latest symptom? That, on Prod, the users arantzazan,ashlyn,explore_la,sam63,ThereNBackAgain have blank/white avatars? (@thescurry @southerneer @irfirl)

thescurry commented 6 years ago

Hello @bengtan I have avatars for those users, but on Prod I find "blanks" for different users. For example: @hayleywelsh0923, @HORSELOVER, @jallie, @jwie86, @kcounsil1, @liam... and probably 40-50 others have a similarly missing/white blank.

image from ios 11

bengtan commented 6 years ago

Interesting.

I can see avatars for all those accounts on Prod (hayleywelsh0923,Horselover, Jallie,kcounsil1,liam).

I have a number of things for you to try please.

@thescurry, @mstidham, either or both of you, please give this a try.

@mstidham: For the following, the accounts I'd like you to check are: arantzazan,ashlyn,explore_la,sam63,ThereNBackAgain.

@thescurry: For the following, the accounts I'd like you to check are: hayleywelsh0923,Horselover,Jallie,kcounsil1,liam.

A. Please view those accounts on the Friends list. Wait for up to 10 seconds to see if the avatar eventually appears.

(For me, sometimes the avatar takes a few seconds to appear. I'd like to see whether it's just a long loading time at fault.)

B. Search for those accounts using the user search. When an account appears in the search results, please wait for up to 10 seconds to see if the avatar eventually appears.

(I use B to try to reproduce. I can't do A because I don't have those accounts in my Friends list. I'd like to see if there's a difference between the Friends list and the user search results)


If avatars still don't appear for those accounts, please do:

C. Uninstall and reinstall. Then do A and B again.

For this test, I'd like to know whether it's always the same accounts with missing avatars, or whether it's a different/random set each time.


Please report back the results, thanks.

aksonov commented 6 years ago

@bengtan I think it could be connected with very long 'friends' list for @thescurry and @mstidham. Probably you don't have such long list.

The app retrieves a roster via XMPP and sends a lot of XMPP requests afterwards to get URL for avatar TROS URLs. I believe we must include real image URLs into the roster or switch to graphql to solve this issue.

bengtan commented 6 years ago

@aksonov:

I think it could be connected with very long 'friends' list for thescurry and mstidham.

Yeah, I looked at @thescurry's traffic logs. The roster is about 217k of xml and it's loaded every app load (I think).

Probably you don't have such long list.

True.

The app retrieves a roster via XMPP and sends a lot of XMPP requests afterwards to get URL for avatar TROS URLs. I believe we must include real image URLs into the roster or switch to graphql to solve this issue.

That's why I've asked for the testers to try testing by using the user search. I think the user search gets images from graphql, or a few at a time instead of all at once.

But ... even if there are a lot of avatars to load, the app should still be able to gracefully handle failures, timeouts etc., and try again later.

aksonov commented 6 years ago

But ... even if there are a lot of avatars to load, the app should still be able to gracefully handle failures, timeouts etc., and try again later.

Agree. Unfortunately I can't login under Steve's account to debug issue. I need bypass account to debug.

mstidham commented 6 years ago

A - Avatar did not load B - Avatar did not load C - (A) All avatars loaded with the exception of John Wie (@jwie86) C - (B) Searched for John Wie (@jwie86) and avatar did not load

bengtan commented 6 years ago

A - Avatar did not load B - Avatar did not load C - (A) All avatars loaded with the exception of John Wie (@jwie86) C - (B) Searched for John Wie (@jwie86) and avatar did not load

Well, that's interesting.

It suggests that, if given enough time to load, the app does eventually load all the avatars. But if not given enough time to load (ie. initially), then some of the avatars may fail to load (ie. network congestion, timeout, etc.) and then get stuck in that state.

(jwie86 is a special case. The server side data for that one is 'bad'.)


Also, @aksonov informs me that there isn't retry logic in the app for loading of user avatars during app-start/roster-initialisation, so if there are a lot of items in the roster (which is the case for Steve and Miranda), some of them may fail to load in a timely manner.

aksonov commented 6 years ago

I will try to implement retry logic

On 10 Oct 2018, at 06:36, Beng Tan notifications@github.com wrote:

A - Avatar did not load B - Avatar did not load C - (A) All avatars loaded with the exception of John Wie (@jwie86) C - (B) Searched for John Wie (@jwie86) and avatar did not load

Well, that's interesting.

It suggests that, if given enough time to load, the app does eventually load all the avatars. But if not given enough time to load (ie. initially), then some of the avatars may fail to load (ie. network congestion, timeout, etc.) and then get stuck in that state.

(jwie86 is a special case. The server side data for that one is 'bad'.)

Also, @aksonov informs me that there isn't retry logic in the app for loading of user avatars during app-start/roster-initialisation, so if there are a lot of items in the roster (which is the case for Steve and Miranda), some of them may fail to load in a timely manner.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

aksonov commented 6 years ago

Any bypass account with long friend list?

On 10 Oct 2018, at 06:36, Beng Tan notifications@github.com wrote:

A - Avatar did not load B - Avatar did not load C - (A) All avatars loaded with the exception of John Wie (@jwie86) C - (B) Searched for John Wie (@jwie86) and avatar did not load

Well, that's interesting.

It suggests that, if given enough time to load, the app does eventually load all the avatars. But if not given enough time to load (ie. initially), then some of the avatars may fail to load (ie. network congestion, timeout, etc.) and then get stuck in that state.

(jwie86 is a special case. The server side data for that one is 'bad'.)

Also, @aksonov informs me that there isn't retry logic in the app for loading of user avatars during app-start/roster-initialisation, so if there are a lot of items in the roster (which is the case for Steve and Miranda), some of them may fail to load in a timely manner.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

bengtan commented 6 years ago

@aksonov: testytester on Staging, maybe.

mstidham commented 6 years ago

Testytester (191-9191) has a long friends list but is not missing any avatars on Staging.

aksonov commented 6 years ago

@mstidham Probably production account has more friends than testyuser. Could you create more bypass users (with avatars) and add them to testyuser? We need to reproduce this issue on staging, bypass user to able to debug.

mstidham commented 6 years ago

@aksonov testytester has 157 Friends and I have added 4 more with avatars and all of the avatars are displaying. @miranda only has 62 Friends on Prod. I will continue to follow all users and increase the size of Friends List.

aksonov commented 6 years ago

No need if staging account has more users already.

aksonov commented 6 years ago

Btw, it is necessary to count friends with avatars.

mstidham commented 6 years ago

testytester has 81 friends with Avatars on Staging & @miranda on Prod has 16 friends with avatars.

aksonov commented 6 years ago

Very strange. Have you tried to login testyuser with clean install, with same connection as prod?

On 11 Oct 2018, at 15:28, mstidham notifications@github.com wrote:

testytester has 81 friends with Avatars on Staging & @miranda on Prod has 16 friends with avatars.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mstidham commented 6 years ago

I'm not positive what you mean by same connection as prod?

On Staging Version: 3.5.0 (Clean Install), I was able to reproduce. I'm missing an avatar for user @sounds on @testytester account.

img_1621

mstidham commented 6 years ago

Clean install of Staging Version: 3.7.0 and all avatars load.

aksonov commented 6 years ago

I mean the same internet connection = Wi-Fi or LTE.

All I want is to get some clear steps to reproduce the issue on staging with bypass account.

11 окт. 2018 г., в 15:59, mstidham notifications@github.com написал(а):

I'm not positive what you mean by same connection as prod?

On Staging Version: 3.5.0 (Clean Install), I was able to reproduce. I'm missing an avatar for user @sounds https://github.com/sounds on @TestyTester https://github.com/TestyTester account.

https://user-images.githubusercontent.com/20051373/46808569-49803d00-cd32-11e8-9ccd-8c2a9493ddae.PNG — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hippware/rn-chat/issues/2511#issuecomment-428962142, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQpccSJkMyHs2-IyGLmOEBoiOkWC2nnks5uj067gaJpZM4U4c6v.

mstidham commented 6 years ago

I'm on WiFi on all accounts.

aksonov commented 6 years ago

I can't reproduce it on staging

bengtan commented 6 years ago

How about trying the Network Link Conditioner to try to make it more likely to happen?

https://hippware.slack.com/archives/C033V7WGA/p1493001127998793

If it still doesn't happen on Staging, or if it remains unreproducible, at some point ... we should spend our time on other things and come back to this post-release.

bengtan commented 6 years ago

How about trying the Network Link Conditioner to try to make it more likely to happen?

There's an equivalent for macOS to use with the iPhone simulator.