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-04-27] [HOLD for payment 2023-04-26] [$1000] The edited message doesn't update on LHN in offline mode #17212

Closed
2 of 6 tasks
kavimuru opened this issue Apr 9, 2023 · 39 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@kavimuru
Copy link

kavimuru commented Apr 9, 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. Go to web chrome
  2. Turn off your wifi
  3. Go to any chat and send a message
  4. Now edit the message and notice that it doesn't update on LHN

Expected Result:

The edited message should be updated on LHN on offline mode

Actual Result:

The edited message doesn't update on LHN on offline mode

Workaround:

unknown

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.2.97-2
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

error-2023-04-09_14.23.14.mp4
Recording.182.mp4

Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681029679583489

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01953a5f80d1aa943c
  • Upwork Job ID: 1645857226176536576
  • Last Price Increase: 2023-04-11
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 9, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 9, 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

@sonialiap
Copy link
Contributor

Reproducible

@MelvinBot
Copy link

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

@sonialiap
Copy link
Contributor

Same behavior on the Android native app. I wonder if this is intentional

@francoisl
Copy link
Contributor

Editing a message should be an optimistic action, so I don't think it's supposed to be intentional.

@francoisl francoisl added the External Added to denote the issue can be worked on by a contributor label Apr 11, 2023
@melvin-bot melvin-bot bot changed the title The edited message doesn't update on LHN in offline mode [$1000] The edited message doesn't update on LHN in offline mode Apr 11, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~01953a5f80d1aa943c

@MelvinBot
Copy link

Current assignee @sonialiap 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 - @fedirjh (External)

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

dukenv0307 commented Apr 11, 2023

Proposal

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

The edited message doesn't update on LHN in offline mode

What is the root cause of that problem?

function editReportComment(reportID, originalReportAction, textForNewComment) {

In UpdateComment API, we are setting optimisticData for ReportActions field but not for the Report field. So that the lastMessageText in the Report field in ONYX is not updated when editing offline

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

If we updated the last report action, we should add optimistcData for the Report field that includes: lastActionCreated, lastActorEmail, lastMessageHtml, lastMessageText.

EDITED: should ignore this suggestion because I see that we also don't add pendingAction into optimisticReport in deleteComment API and addComment API
Optional, for consistency, we can consider adding pendingAction for the optimisticReport like optimisticReportActions.

What alternative solutions did you explore? (Optional)

NA

Result

Screen.Recording.2023-04-11.at.15.07.23.mov

@MelvinBot
Copy link

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

@fedirjh
Copy link
Contributor

fedirjh commented Apr 12, 2023

@dukenv0307 Thank you for the proposal. Could you please consider reformatting your proposal to improve its readability ? Specifically this part :

Optional, we can consider adding pendingAction for the Report field in the optimistic Data. If do that we also need to reset pedingAction of Report is null in failureData and successData


The proposal looks good to me. Looking at the codebase addComment and deleteComment both set optimisticReport , while editReportComment doesn’t. Adding optimisticReport seems like a straightforward solution. Just one suggestion , we should add optimisticReport only when the edited message is the last visible message.

All yours @francoisl

C+ reviewed 🎀👀🎀

@dukenv0307
Copy link
Contributor

Could you please consider reformatting your proposal to improve its readability ? Specifically this part :

@fedirjh Updated proposal

@kaushiktd
Copy link
Contributor

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

The edited message doesn't update on LHN in offline mode

What is the root cause of that problem?

When the user edited an existing message, editReportComment() is called from below mentioned file:

function editReportComment(reportID, originalReportAction, textForNewComment) {

This function is setting up optimisticData only for ReportActions, not for Reports fields. So the last message is not updating in the Report field.

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

We need to add optimisticData for the Report field so it can be updated for Report Fields. For this please add the below code in mentioned file:

const currentTime = DateUtils.getDBTime();
const optimisticReport = {
    lastVisibleActionCreated: currentTime,
    lastMessageText: ReportUtils.formatReportLastMessageText(htmlForNewComment),
    lastActorEmail: currentUserEmail,
    lastReadTime: currentTime,
};

and update optimisticData value like below:

const optimisticData = [
       {
           onyxMethod: CONST.ONYX.METHOD.MERGE,
           key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
           value: optimisticReport,
       },
       {
           onyxMethod: CONST.ONYX.METHOD.MERGE,
           key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
           value: optimisticReportActions,
       },
   ];

Video File:

https://drive.google.com/file/d/1k54k7EluDa8sBIU1C78QmJtUabV6-dht/view?usp=share_link

@fedirjh
Copy link
Contributor

fedirjh commented Apr 12, 2023

@kaushiktd Your proposal is a duplicate of @dukenv0307's proposal , Please make sure to follow contributing rules when proposing new proposal.

Note: Before submitting a proposal on an issue, be sure to read any other existing proposals. ALL NEW PROPOSALS MUST BE DIFFERENT FROM EXISTING PROPOSALS. The difference should be important, meaningful or considerable.

@francoisl
Copy link
Contributor

👍 @dukenv0307 your proposal sounds good, let's go with it.

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

📣 @dukenv0307 You have been assigned to this job by @francoisl!
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 📖

@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Apr 19, 2023
@melvin-bot melvin-bot bot changed the title [$1000] The edited message doesn't update on LHN in offline mode [HOLD for payment 2023-04-26] [$1000] The edited message doesn't update on LHN in offline mode Apr 19, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 19, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.1-3 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-04-26. 🎊

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

@MelvinBot
Copy link

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@sonialiap] Determine if we should create a regression test for this bug.
  • [@fedirjh] 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.
  • [@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Apr 20, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-04-26] [$1000] The edited message doesn't update on LHN in offline mode [HOLD for payment 2023-04-27] [HOLD for payment 2023-04-26] [$1000] The edited message doesn't update on LHN in offline mode Apr 20, 2023
@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.2-5 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-04-27. 🎊

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

@MelvinBot
Copy link

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] 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:
  • [@fedirjh] 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:
  • [@sonialiap] Determine if we should create a regression test for this bug.
  • [@fedirjh] 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.
  • [@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 26, 2023
@fedirjh
Copy link
Contributor

fedirjh commented Apr 27, 2023

  1. The PR that introduced the bug has been identified. Link to the PR: Edit Comments #2320 This PR implemented the 'edit comments' feature, but it misses the case where a user edits their last sent message while offline
  2. The offending PR has been commented on : Not sure if this apply here.
  3. A discussion in #expensify-bugs has been started : There is an item in the checklist related to Offline testing
  4. Regression test : [HOLD for payment 2023-04-27] [HOLD for payment 2023-04-26] [$1000] The edited message doesn't update on LHN in offline mode #17212 (comment)

@melvin-bot melvin-bot bot added the Overdue label May 1, 2023
@MelvinBot
Copy link

@francoisl, @sonialiap, @fedirjh, @dukenv0307 Eep! 4 days overdue now. Issues have feelings too...

@fedirjh
Copy link
Contributor

fedirjh commented May 2, 2023

It's awaiting payment.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels May 2, 2023
@sonialiap
Copy link
Contributor

@dukenv0307 offer sent for fixing the issue (+ bonus for merging under 3 days)
@fedirjh offer sent for reviewing (+ bonus for merging under 3 days, - regression = base price for issue)

@melvin-bot melvin-bot bot removed the Overdue label May 5, 2023
@sonialiap
Copy link
Contributor

@priya-zha is this your Upwork profile? Confirming so that I make sure I send the offer to the correct person :)

@priya-zha
Copy link

priya-zha commented May 5, 2023

@sonialiap The profile that you mentioned is not mine. My profile is : https://www.upwork.com/freelancers/~011e32317dbbd489e0

@melvin-bot melvin-bot bot added the Overdue label May 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 8, 2023

@francoisl, @sonialiap, @fedirjh, @dukenv0307 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@sonialiap
Copy link
Contributor

@dukenv0307 paid
@fedirjh paid

@priya-zha thanks for the link. Offer sent for reporting issue

@melvin-bot melvin-bot bot removed the Overdue label May 9, 2023
@priya-zha
Copy link

Thanks accepted.

@sonialiap
Copy link
Contributor

@priya-zha paid! :)

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants