App icon indicating copy to clipboard operation
App copied to clipboard

Android - Room- Room chat logo appears after add attachment

Open kbecciv opened this issue 4 years ago • 12 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. Lunch the app
  2. Log in with expensifail account
  3. Tap on Fub menu - Room
  4. Name the room and select workspace
  5. Tap create room
  6. After room created add attachment

Expected Result:

Room chat logo should appears after create a room

Actual Result:

Room chat logo appears after add attachment

Workaround:

Uknown

Platform:

Where is this issue occurring?

  • Android

Version Number: 1.1.26.1

Reproducible in staging?: Yes

Reproducible in production?: No

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

https://user-images.githubusercontent.com/93399543/148577267-0378af32-7ae9-4b15-b3d1-8d94b61b40ef.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause

Slack conversation:

View all open jobs on GitHub

kbecciv avatar Jan 07 '22 16:01 kbecciv

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

MelvinBot avatar Jan 07 '22 16:01 MelvinBot

This definitely seems like something an external contributor could work on.

deetergp avatar Jan 08 '22 00:01 deetergp

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

MelvinBot avatar Jan 08 '22 00:01 MelvinBot

Proposal

  1. So I found out that we recently change the icons on report data to have [' '] for chat rooms. https://github.com/Expensify/App/commit/02918f0fbf3f5f3c5804ca1375b82ee1236aa003. I basically do not understand the purpose of this. cc: @TomatoToaster .

In the same PR, we updated the EmptyStateAvatar https://github.com/Expensify/App/blob/e5f44024539e9276adfa6815a2682a3e04f3bf14/src/components/EmptyStateAvatars.js#L28.

But as HeaderView does not take the option same as LHN. we need to correct the MultipleAvatar component as well https://github.com/Expensify/App/blob/60671001cc6e01cda69d8fcffd7e8eec13fb0f75/src/components/MultipleAvatars.js#L46.

So that it renders the images for Rooms.

We need to add another check for props.isChatRoom to the condition.

But I think https://github.com/Expensify/App/blob/e5f44024539e9276adfa6815a2682a3e04f3bf14/src/components/EmptyStateAvatars.js#L24 is also needs to be changed. As it will fail for the same reason as before does not take the option same as LHN..

We have to update this condition and allow to pass the control to next condition via adding !props.isChatRoom to it.

It may also require a small refactor as https://github.com/Expensify/App/blob/e5f44024539e9276adfa6815a2682a3e04f3bf14/src/components/EmptyStateAvatars.js#L31 It could fail when props.avatarImageURLs is undefined.

But I would like to ask @TomatoToaster about https://github.com/Expensify/App/commit/02918f0fbf3f5f3c5804ca1375b82ee1236aa003. Why is this necessary?

parasharrajat avatar Jan 08 '22 02:01 parasharrajat

@parasharrajat It has been the case for a while that chatRooms like defaultRooms used [''] for their reportIcons

Chat rooms always use the default lounge chair icon (or the archived icon if they are archived) that's why they never need to look at personalDetails of their members. I added that line because for private User Created Policy Rooms, it is possible to have no other members in the chat room. So in that line of code, personalDetail.avatar would throw an undefined TypeError because personalDetail = personalDetailList[0]

In the same PR, we updated the EmptyStateAvatar

This was not really updated, previously this was the case for defaultRooms already so it was just updating to use chatRooms so User Created Policy Rooms could also get this behavior.

But as HeaderView does not take the option same as LHN. we need to correct the MultipleAvatar component as well

So that it renders the images for Rooms.

We need to add another check for props.isChatRoom to the condition.

But I think

is also needs to be changed. As it will fail for the same reason as before does not take the option same as LHN..

We have to update this condition and allow to pass the control to next condition via adding !props.isChatRoom to it.

I'm a little confused about this part, wouldn't these work fine since [''].length = 1? I think I might be misunderstanding this part could you clarify.

TomatoToaster avatar Jan 09 '22 02:01 TomatoToaster

@deetergp did you mean to remove me from assignment here?

kadiealexander avatar Jan 09 '22 23:01 kadiealexander

Thanks for the context @TomatoToaster.

I'm a little confused about this part, wouldn't these work fine since [''].length = 1? I think I might be misunderstanding this part could you clarify.

I was planning to clean up the code.

parasharrajat avatar Jan 10 '22 05:01 parasharrajat

I tested the solution but It seems to be that LHN Is getting the icons property but ReportScreen and HeaderView do not. A possible theory is that due to https://github.com/Expensify/App/blob/60671001cc6e01cda69d8fcffd7e8eec13fb0f75/src/libs/actions/PersonalDetails.js#L162 , icons are not updated at all on the report data as the participant's list is empty.

LHN calls getOptions where you added code to create the icons but how will the main report data get this? I think a better solution would be to directly render the Room icon when props.isChatRoom is true. So for this, I was suggesting removing the https://github.com/Expensify/App/blob/e5f44024539e9276adfa6815a2682a3e04f3bf14/src/components/EmptyStateAvatars.js#L24 check for props.isChatRoom= true.

parasharrajat avatar Jan 10 '22 08:01 parasharrajat

Issue not reproducible during KI retests. (First week)

mvtglobally avatar Feb 01 '22 05:02 mvtglobally

Oh no, @kadiealexander, un-assigning you was completely by accident. I must have "unassigned everybody" around the same time the External label added you.

According to @mvtglobally this issue is no longer reproducible during the KI retests. Let's let it ride through next week and if that is still the case, I will close it. Otherwise, @kadiealexander, I'll add you back and we'll go from there.

deetergp avatar Feb 02 '22 00:02 deetergp

Issue not reproducible during KI retests. (Second week)

mvtglobally avatar Feb 08 '22 05:02 mvtglobally

Not reproducible after two weeks, so I am closing it.

deetergp avatar Feb 08 '22 18:02 deetergp