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

[$500] LHN last message is not updating after deleting attachment #26564

Closed
1 of 6 tasks
kavimuru opened this issue Sep 2, 2023 · 11 comments
Closed
1 of 6 tasks

[$500] LHN last message is not updating after deleting attachment #26564

kavimuru opened this issue Sep 2, 2023 · 11 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kavimuru
Copy link

kavimuru commented Sep 2, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open any report
  2. Send any attachment
  3. Observe the sub-title in LHN
  4. Click on attachment in tab 1 see it opens in modal
  5. Open same report in other tab (tab2) and delete the attachement.
  6. Observe that after delete modal get's closed but not LHN updating.

Expected Result:

LHN should update as well with next previous message

Actual Result:

Not updating

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.62-1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Kapture.2023-08-25.at.20.30.54.mp4
Recording.1554.mp4

Expensify/Expensify Issue URL:
Issue reported by: @b4s36t4
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692975870405119

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017f650b305c679ab3
  • Upwork Job ID: 1698475872240963584
  • Last Price Increase: 2023-09-10
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 2, 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

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Sep 3, 2023
@melvin-bot melvin-bot bot changed the title LHN last message is not updating after deleting attachment [$500] LHN last message is not updating after deleting attachment Sep 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 3, 2023

Job added to Upwork: https://www.upwork.com/jobs/~017f650b305c679ab3

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

melvin-bot bot commented Sep 3, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 3, 2023

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

@rojiphil
Copy link
Contributor

rojiphil commented Sep 5, 2023

Proposal

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

LHN last message is not updating after deleting the attachment

What is the root cause of that problem?

The function getLastMessageTextForReport as shown here is used to decide on the text used in LHN. Now, within getLastMessageTextForReport, we use isReportMessageAttachment here to find out if the lastMessageTextFromReport is an attachment. Since lastMessageText and lastMessageHtml is sufficient to decide on whether it is attachment or not based on code here, we can depend on them for making this decision. However, the decision is also based on lastMessageTranslationKey which does not seem proper here. Using lastMessageTranslationKey to decide on the lastMessageTextFromReport seems to be the reason for this problem.

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

We can avoid using lastMessageTranslationKey as follows here

if (ReportUtils.isReportMessageAttachment({text: report.lastMessageText, html: report.lastMessageHtml})) {

The above condition is safe as lastMessageTranslationKey itself is determined based on lastMessageText and lastMessageHtml as shown here in getLastVisibleMessage function.

In addition, we also need to set the lastMessageText here by taking locale into consideration as follows. This is to avoid showing of text common.attachment for a short period of time

lastMessageText: Localize.translateLocal(CONST.TRANSLATION_KEYS.ATTACHMENT),

Further, I am not sure if there is a need to set lastMessageHtml here as part of implementation of PR here.
I have asked a query there.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Sep 5, 2023
@DylanDylann
Copy link
Contributor

The pusher doesn't return lastMesageTranslationKey

Screenshot 2023-09-05 at 17 16 20

I think we should fix this from BE side

rojiphil added a commit to rojiphil/App that referenced this issue Sep 5, 2023
@adelekennedy
Copy link

@jjcoffee can you review the proposals above?

@melvin-bot melvin-bot bot removed the Overdue label Sep 6, 2023
@jjcoffee
Copy link
Contributor

jjcoffee commented Sep 7, 2023

This seems like a pretty edgy edge case to me! It requires being signed in as the same user in two tabs, which in itself is a pretty unlikely use case - but then adding on top of that trying to switch between tabs and make actions on one and see the changes on another is just not something I think a normal user would do. I recommend closing unless there's a deeper issue. cc @adelekennedy

Additionally, the RCAs proposed so far don't seem to be correct as the behaviour doesn't happen when logged in to a separate account, but lastMesageTranslationKey is also not returned in the pusher event in that case:
image

@melvin-bot
Copy link

melvin-bot bot commented Sep 10, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Sep 10, 2023
@adelekennedy
Copy link

Let's close this! I love eliminating edge cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

5 participants