App icon indicating copy to clipboard operation
App copied to clipboard

[Wave 8] [Ideal Nav] Issues with the bold (unread) status on Workspace Item

Open hayata-suenaga opened this issue 1 year ago • 13 comments

Action Performed:

The workspace item on the Workspace Switcher should be bold when there are any unread chat/report in that workspace. This indicator, however, isn't working consistently.

Sometimes, the workspace item is bold even when there is no unread chat in that workspace. And sometimes, it's not bold when there is a unread chat/report.

The following is the reproduction step for the latter issue.

  1. Create a workspace if you don't have one yet.
  2. Go to a workspace (not Expensify one).
  3. Right click (or long press) a chat and click Mark as unread on the popover that appears
  4. Click the Workspace Switcher.
  5. Look for the current workspace name. Confirm that the workspace name is bold.
  6. Go back to the workspace.
  7. Right click the same chat and click Mark as read
  8. Go back to Workspace Switcher
  9. Confirm the current workspace is not bold

https://github.com/Expensify/App/assets/98560306/bb189b08-1d8a-4e97-9215-f7ad861808a8

Workaround:

N/A

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • [x] Android: Native
  • [x] Android: mWeb Chrome
  • [x] iOS: Native
  • [x] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [x] MacOS: Desktop

Screenshots/Videos

Vides are attached above.

View all open jobs on GitHub

hayata-suenaga avatar Feb 02 '24 17:02 hayata-suenaga

Triggered auto assignment to @Christinadobrzyn (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] avatar Feb 02 '24 17:02 melvin-bot[bot]

@mateuuszzzzz I believe you're working on this regression? can you comment on this GH issue so that I can assign you?

hayata-suenaga avatar Feb 02 '24 17:02 hayata-suenaga

Ah good catch! I can reproduce this - we'll see if @mateuuszzzzz is working on this!

Christinadobrzyn avatar Feb 02 '24 22:02 Christinadobrzyn

Hello, I'll be working on this one and take it from @mateuuszzzzz.

cdOut avatar Feb 05 '24 10:02 cdOut

Nice, assigned you @cdOut!

trjExpensify avatar Feb 05 '24 10:02 trjExpensify

While debugging a similar issue (https://github.com/Expensify/App/issues/35766) which was closed as a dupe of this one I noticed the following:

  • within the ReportUtils.isUnread function we're checking the lastReadTime which if undefined will fallback to empty string
  • in WorkspacesSettingsUtils we're using Onyx.connect to get allReports
  • sometimes for certain workspaces -> reports within that workspace will initially have the lastReadTime as undefined
  • undefined lastReadTime defaults to empty string which when compared to an existing lastVisibleActionCreated date string, isUnread always returns true

Considering these, I tend to think that the RC here might come from the Onyx.connect -> allReports data which might first initialize some report variables as undefined - while shortly after to become defined but the function doesn't register the data change and remains with initial isUnread status.

Hope this helps w/ debugging ✌️

ikevin127 avatar Feb 05 '24 14:02 ikevin127

Interesting, thanks for sharing the info @ikevin127!

cdOut avatar Feb 05 '24 14:02 cdOut

update - we're working on debugging/PR for this!

Christinadobrzyn avatar Feb 06 '24 19:02 Christinadobrzyn

I am interested in reviewing this since I was C+ in dupe issue

situchan avatar Feb 06 '24 19:02 situchan

hey just a quick question here... testing this again and talking over this issue with @cdOut... I'm not sure if the steps in the OP are correct or are the issue we're trying to fix.

What I see when testing:

  1. Create a workspace if you don't have one yet.
  2. Go to a workspace (not Expensify one).
  3. Right click (or long press) a chat and click Mark as unread on the popover that appears
  4. Click the Workspace Switcher.
  5. Verify that the workspace is bold
  6. Go back to the workspace and right click (or long press) to mark as read
  7. Verify that the workspace is not bold

https://github.com/Expensify/App/assets/51066321/3aa046e6-0c70-4f70-bc09-86898a924bbb

  1. I don't think the checkmark matters here, the checkmark is the default workspace, yeah?
  2. Is the green dot behaviour incorrect? I think that might be the issue - shouldn't the green dot show for unread and not show for read?

So isn't this behaviour correct? @hayata-suenaga @trjExpensify @situchan

Christinadobrzyn avatar Feb 06 '24 20:02 Christinadobrzyn

@Christinadobrzyn I'm sorry. I mistyped the step #6. You're correct. We want to check if the workspace name is bold or not.

There is another issue that is handling RBR and GBR.

hayata-suenaga avatar Feb 06 '24 21:02 hayata-suenaga

Ah okay, thanks @hayata-suenaga so if that's the case, I think this might be fixed? Could you test again and let me know if the bold isn't working? TY! Or I can ask QA to test again if needed!

Christinadobrzyn avatar Feb 06 '24 21:02 Christinadobrzyn

I still seem to have a phantom unread workspace on v1.4.37-2:

image

I've clicked into all of the chats on that workspace and can't seem to clear it.

trjExpensify avatar Feb 06 '24 23:02 trjExpensify

I still seem to have a phantom unread workspace on v1.4.37-2: image

I've clicked into all of the chats on that workspace and can't seem to clear it.

That's exactly the problem that I was also able to replicate and was working on a fix on this, just wanted to clarify that that's the only issue appearing currently with bold. Thanks for retesting and specifying the issue!

cdOut avatar Feb 07 '24 01:02 cdOut

Dopeeee! Any idea what it is? 🕵️

trjExpensify avatar Feb 07 '24 01:02 trjExpensify

The issue appears to be occuring on old accounts which already had different reports created but due to updates to different flows they were hidden from the users view without ever gaining the lastReadTime property, which we use to determine whether we should use bold for the workspaces in the switcher.

I do have an old account that has a hidden report in the Everything section of the switcher, but I'd appreciate if I could log into the account you used for the video @trjExpensify with a hidden report in a user created workspace so I can test that case also. I've messaged you on slack about it.

cdOut avatar Feb 08 '24 12:02 cdOut

Chatted about this earlier. I can't provide access to my real Expensify account where this is shown in the vid. I'll test an adhoc build though when ready!

trjExpensify avatar Feb 08 '24 17:02 trjExpensify

As an update I will be creating a PR for this today or tomorrow.

cdOut avatar Feb 12 '24 13:02 cdOut

Wahoo, nice! 👍

trjExpensify avatar Feb 12 '24 15:02 trjExpensify

Awesome! Thanks @cdOut! Let us know if you need anything for the PR

Christinadobrzyn avatar Feb 14 '24 00:02 Christinadobrzyn

@cdOut let us know once you open a PR 🙇

hayata-suenaga avatar Feb 14 '24 16:02 hayata-suenaga

I am still working on fixing this issue, I'm currently revising what reports are shown to the user on the LHP so I can properly display the unread reports, which after testing different scenarios I found out are still available reports that the user can manually go to but they do not appear properly on the list.

cdOut avatar Feb 15 '24 19:02 cdOut

@Christinadobrzyn @cdOut @hayata-suenaga @situchan this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Feb 16 '24 15:02 melvin-bot[bot]

which after testing different scenarios I found out are still available reports that the user can manually go to but they do not appear properly on the list.

hi @cdOut, I'm having a bit of trouble understanding the sentence above. Would you mind clarifying it for me? Thanks!

hayata-suenaga avatar Feb 16 '24 16:02 hayata-suenaga

@cdOut, could you report on the progress of this when you have time? 🙇

hayata-suenaga avatar Feb 19 '24 18:02 hayata-suenaga

I was OOO due to a fever these past days, I'll get back on this issue today and write up a follow up with progress for you later today.

cdOut avatar Feb 22 '24 08:02 cdOut

thank you for the update and I hope you recovered fully 🍀

hayata-suenaga avatar Feb 22 '24 15:02 hayata-suenaga

@Christinadobrzyn @cdOut @hayata-suenaga @situchan this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

melvin-bot[bot] avatar Feb 23 '24 15:02 melvin-bot[bot]

melvin, @cdOut is going to provide an update later once they recover.

hayata-suenaga avatar Feb 23 '24 15:02 hayata-suenaga

@Christinadobrzyn, @cdOut, @hayata-suenaga, @situchan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Feb 26 '24 15:02 melvin-bot[bot]