Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2023-05-16] [$1000] Make LHN Preview for Archived chats consistent #17386

Closed
mountiny opened this issue Apr 13, 2023 · 42 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@mountiny
Copy link
Contributor

mountiny commented Apr 13, 2023

Coming from here

### Problem

Currently the preview of archived chats contains the last message sent, except if the chat is a policy expense chat. If it’s a policy expense chat, it will show the reason for the archive reason, ex: This workspace chat is no longer active because is no longer an active workspace.. This causes difference in behavior for no apparent reason, since both types of chats can have content.
In the images below there’s the before and after the workspace deletion, where all chats had content. Note that only the non policy expense chat contain the last message preview.

### Solution

Use the same behaviour for all chats, so that it is consistent.

  1. If there is some message before the room/ policy expense chat has been archived, show that message
  2. If there is no message in the archived chat, show the Closed report action message. ie This workspace has been archived because XYZ But this message will be trimmed in the preview.

image

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c1f0e5d8fc4290e0
  • Upwork Job ID: 1646456802523676672
  • Last Price Increase: 2023-04-13
@mountiny mountiny added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 13, 2023
@mountiny mountiny self-assigned this Apr 13, 2023
@MelvinBot
Copy link

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

@mountiny
Copy link
Contributor Author

cc @BeeMargarida

@MelvinBot
Copy link

MelvinBot commented Apr 13, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@BeeMargarida
Copy link
Contributor

Hello, Ana from Callstack here, I can pick this up!

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Apr 13, 2023
@melvin-bot melvin-bot bot changed the title Make LHN Preview for Archived chats consistent [$1000] Make LHN Preview for Archived chats consistent Apr 13, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~01c1f0e5d8fc4290e0

@MelvinBot
Copy link

Current assignee @sophiepintoraetz is eligible for the External assigner, not assigning anyone new.

@MelvinBot
Copy link

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 13, 2023
@MelvinBot
Copy link

Current assignee @mountiny is eligible for the External assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 13, 2023
@MelvinBot
Copy link

📣 @BeeMargarida You have been assigned to this job by @mountiny!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@mountiny
Copy link
Contributor Author

This is on hold for #17363 as now the archived chats dont show 😢

@mountiny mountiny changed the title [$1000] Make LHN Preview for Archived chats consistent [HOLD #17363] [$1000] Make LHN Preview for Archived chats consistent Apr 13, 2023
@mountiny mountiny added Weekly KSv2 and removed Daily KSv2 labels Apr 13, 2023
@mountiny mountiny changed the title [HOLD #17363] [$1000] Make LHN Preview for Archived chats consistent [$1000] Make LHN Preview for Archived chats consistent Apr 18, 2023
@mountiny
Copy link
Contributor Author

@BeeMargarida This is off hold now, the archived chats should be accessible in the LHN

@mountiny mountiny added Daily KSv2 and removed Weekly KSv2 labels Apr 18, 2023
@BeeMargarida
Copy link
Contributor

This is off hold now, the archived chats should be accessible in the LHN

Will tackle it next!

@BeeMargarida
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

No consistency between archived rooms preview, archived rooms and policy expense chats show different things.

What is the root cause of that problem?

There is different logic for when a report is a policy expense chat:

if (result.isPolicyExpenseChat && result.isArchivedRoom) {

When it's a policy expense chat, it shows the archived reason, even if there is a last message.

What changes do you think we should make in order to solve the problem?

Change the check mentioned above so that it only checks if a room is archived and there is no last message.

From result.isPolicyExpenseChat && result.isArchivedRoom to result.isArchivedRoom && lastMessageText.length === 0.

Also, it will be necessary to change the check below that changes the preview text to No Activity yet if the last message is empty. This should only run if the message is empty and the chat is not archived.

From result.isChatRoom || result.isPolicyExpenseChat to (result.isChatRoom || result.isPolicyExpenseChat) && !result.isArchivedRoom.

The first change can be applied in OptionsListUtils.js, since we don't want different behaviour between 'default' rooms and policy expense chats.
However, the other check can't be applied since there's extra logic in OptionsListUtils.js that allows forcing the preview to be the chat room subtitle (ex: policy name or 'workspace') or other things (ex: user preview).

What alternative solutions did you explore? (Optional)

--

@mountiny
Copy link
Contributor Author

Seems fine to me, any concern @rushatgabhane?

@mountiny
Copy link
Contributor Author

Thank you very much, I have left a review

@MelvinBot
Copy link

@BeeMargarida, @rushatgabhane, @mountiny, @sophiepintoraetz Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@BeeMargarida
Copy link
Contributor

Update: Currently being tested internally by QA

@m4rtag
Copy link

m4rtag commented May 4, 2023

RETESTS SUMMARY

This fix is verified on Branch PR Draft *BeeMargarida:fix/17386-consistent_lhn_preview_for_archived_chats 

Tests are conducted on the following devices:
Google Chrome Version 112.0.5615.121 (Official Build) (arm64) at Mac OS Ventura 13.3.1
Safari Version 16.4 (18615.1.26.11.23) at Mac OS Ventura 13.3.1
Expensify Desktop app - New Expensify Electron Version v1.3.1-0, Electron Version 22.3.6 (22.3.6)
iOS native app - iPhone Simulator Version 14.2 (986.5), iOS 16.2, SimulatorKit 627, CoreSimulator 885.2
Safari on iOS - iPhone Simulator 14 iOS 16.2
Android native app v1.3.1-0 - Android Emulator -Nexus_5X_API_TiramisuPrivacySandbox:5554
Chrome 101.0.4951.74, Operating system Android13; Build/TRA4.221021.001.B1 

*As the fix does not meet Solution requirements it is returned to the developer for further investigation

@MelvinBot
Copy link

📣 @m4rtag! 📣

Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.

Screen Shot 2022-11-16 at 4 42 54 PM

Format:

Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@m4rtag
Copy link

m4rtag commented May 4, 2023

Actually, my comment above is obsolete due to newer arrangements, the screenshot can be found below.
image

The above tests are executed with a 100% pass value and may be released onto stage

chat.description.mp4
change.of.description.after.log.out.and.back.in.mp4

@BeeMargarida
Copy link
Contributor

Udpate: PR is ready for review

@rushatgabhane
Copy link
Member

Unassigning because @parasharrajat is reviewing the PR

@rushatgabhane rushatgabhane removed their assignment May 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 5, 2023

📣 @parasharrajat You have been assigned to this job by @mountiny!
Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@mountiny
Copy link
Contributor Author

mountiny commented May 5, 2023

Getting closer with the PR

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels May 9, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Make LHN Preview for Archived chats consistent [HOLD for payment 2023-05-16] [$1000] Make LHN Preview for Archived chats consistent May 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.12-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-05-16. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot

This comment was marked as off-topic.

@parasharrajat
Copy link
Member

This is a feature request.

[@parasharrajat] The PR that introduced the bug has been identified. Link to the PR: NA
[@parasharrajat] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: NA
[@parasharrajat] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: NA

[@parasharrajat] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

@sophiepintoraetz
Copy link
Contributor

All right - I think the only payment due here, should no regressions arise, are $1000 to @parasharrajat - correct? (No timeline bonus applied where callstack are assigned as the contributor)

@mountiny
Copy link
Contributor Author

I think thats correct, thanks!

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels May 15, 2023
@sophiepintoraetz
Copy link
Contributor

All right - contract has been sent! Job is here https://www.upwork.com/jobs/~011fbafcc7f6b88173?frkscc=YaCOyt4kvnp5. (N.B. I am at a conference, Rajat so it may take a little longer to approve payment - only by a day or so!)

@parasharrajat
Copy link
Member

No worries. Accepted the offer @sophiepintoraetz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants