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-11-01] [HOLD on PR #25935] [$1000] Two line markers appear for a second #24648

Closed
1 of 6 tasks
m-natarajan opened this issue Aug 16, 2023 · 41 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Aug 16, 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. Create a task
  2. Send two messages
  3. Mark as Unread the second message
  4. delete the first message

Expected Result:

The new line marker and the message separating the line align immediately

Actual Result:

Two line markers appear for a second

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.3.54-11
Reproducible in staging?: Yes
Reproducible in production?: Yes
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

T102_Twolinemarkers-1.mp4
Recording.370.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0110cb0187ff6d5cbd
  • Upwork Job ID: 1692133559512989696
  • Last Price Increase: 2023-08-17
  • Automatic offers:
    • dukenv0307 | Contributor | 26245331
    • daveSeife | Reporter | 26245335
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 16, 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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Aug 17, 2023

Proposal

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

Two line markers appear for a second

What is the root cause of that problem?

When we online, the reportAction with pendingAction as delete still keeps on sortedReportActions.

So when we delete the first comment, the sortedReportActions[sortedReportActions.length - 2] action still is this action. That makes shouldHideThreadDividerLine doesn't update to true and then two dividers appear until deleteComment API is complete.

const shouldHideThreadDividerLine = sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID;

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

We should get the firstVisibleAction that doesn't have pendingAction is delete to compare with newMarkerReportActionID

function getFirstVisibleAction(sortedReportActions, isOffline) {
    for (let i = sortedReportActions.length - 2; i >= 0; i--) {
        if ((sortedReportActions[i].pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) || isOffline) {
            return sortedReportActions[i];
        }
    }
    return null;
}
const firstVisibleAction = getFirstVisibleAction(sortedReportActions, props.network.isOffline);
const shouldHideThreadDividerLine = sortedReportActions.length > 1 && !!firstVisibleAction && firstVisibleAction.reportActionID === newMarkerReportActionID;

const shouldHideThreadDividerLine = sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID;

What alternative solutions did you explore? (Optional)

NA

Result

Screencast.from.17-08-2023.11.25.06.webm

@DylanDylann
Copy link
Contributor

Proposal

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

Two line markers appear for a second

What is the root cause of that problem?

When removing the message, this message isn't remove from sortedReportActions until the BE return new data. It caused that 2 divider lines are displayed at the same time.
But we can't see this issue on thread chat because in thread chat the new marker and divider line have the same position, the new marker line will overwrite the divider line
in the task report and money report view, we apply margin vertical 8px to divider line

...spacing.mv2,

It make the position of the new marker line and the divider line different.

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

In the task report and money report view, I suggest that we should remove margin (as we did in thread chat) vertical or only use margin top in the divider line
This solution also make report action not flicker when mark as unread

Result

Screen.Recording.2023-08-17.at.17.17.26.mov

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Aug 17, 2023
@melvin-bot melvin-bot bot changed the title Two line markers appear for a second [$1000] Two line markers appear for a second Aug 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0110cb0187ff6d5cbd

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

melvin-bot bot commented Aug 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

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

@garrettmknight
Copy link
Contributor

Reproduced on staging and prod.

@pradeepmdk
Copy link
Contributor

pradeepmdk commented Aug 17, 2023

Proposal

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

Two line markers appear for a second

What is the root cause of that problem?

after deleting the first comment here its changed to sortedReportActions[sortedReportActions.length - 2].pendingAction = 'delete' until delete api finishes at the time reportActionID === newMarkerReportActionID also doesn't match that why showing the line at the time shouldDisplayNewMarker also true

const shouldHideThreadDividerLine = sortedReportActions.length > 1 && sortedReportActions[sortedReportActions.length - 2].reportActionID === newMarkerReportActionID;

Screenshot 2023-08-17 at 6 47 58 PM

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

    const findFirstSortedReportActions = () => {
        const sortedReportActionsFilter = sortedReportActions.filter(item => props.network.isOffline || item.pendingAction != 
           CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
        return  sortedReportActionsFilter.length > 1 && sortedReportActionsFilter[sortedReportActionsFilter.length - 2] || {};
    }
     const shouldHideThreadDividerLine = findFirstSortedReportActions().reportActionID === newMarkerReportActionID 

@parasharrajat
Copy link
Member

@dukenv0307 Can you help me visualize the flow of the solution?

@dukenv0307
Copy link
Contributor

dukenv0307 commented Aug 17, 2023

@parasharrajat As the root cause I mentioned, because the action that has pendingAction is delete keep on sortedActions, so we should find the current first action that is visible in the screen to compare with newMarkerReportActionID. I also can update the check to get the first action to cover the case the action has childAction comment.

@pradeepmdk
Copy link
Contributor

pradeepmdk commented Aug 17, 2023

@parasharrajat, let me know what is the mistake I am done. updated to #24648 (comment)

@parasharrajat
Copy link
Member

@pradeepmdk There is no mistake as such but your proposal matches one of the existing proposals.

@pradeepmdk
Copy link
Contributor

@parasharrajat Sorry, I missed that before the help+wanted label posted the proposals. so I missed that.

@parasharrajat
Copy link
Member

Ok, @dukenv0307 let's simplify your logic on the PR. But proposal looks good to me.

🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

Triggered auto assignment to @yuwenmemon, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot added the Overdue label Aug 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

@garrettmknight, @yuwenmemon, @parasharrajat Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@garrettmknight
Copy link
Contributor

@dukenv0307 do you need anything else from us to get the PR up?

@melvin-bot melvin-bot bot removed the Overdue label Aug 21, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 21, 2023
@melvin-bot melvin-bot bot added the Monthly KSv2 label Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

This issue has not been updated in over 15 days. @garrettmknight, @parasharrajat, @dukenv0307 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@garrettmknight garrettmknight added Weekly KSv2 and removed Monthly KSv2 labels Oct 11, 2023
@garrettmknight
Copy link
Contributor

@dukenv0307 I just tested this and it's performing a bit differently, with the line below the first message. Mind giving this one another look?
Screenshot 2023-10-12 at 10 19 24 AM

@dukenv0307
Copy link
Contributor

dukenv0307 commented Oct 12, 2023

@garrettmknight It comes from another PR. We still waiting for #25935 this PR is merged to continue this issue.

@garrettmknight garrettmknight changed the title [$1000] Two line markers appear for a second [HOLD on PR #25935] [$1000] Two line markers appear for a second Oct 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @dukenv0307 got assigned: 2023-08-21 17:24:44 Z
  • when the PR got merged: 2023-10-23 16:32:33 UTC
  • days elapsed: 44

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 25, 2023
@melvin-bot melvin-bot bot changed the title [HOLD on PR #25935] [$1000] Two line markers appear for a second [HOLD for payment 2023-11-01] [HOLD on PR #25935] [$1000] Two line markers appear for a second Oct 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.90-2 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-11-01. 🎊

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

For reference, here are some details about the assignees on this issue:

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
Copy link

melvin-bot bot commented Oct 25, 2023

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:

  • [@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:
  • [@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:
  • [@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:
  • [@parasharrajat] Determine if we should create a regression test for this bug.
  • [@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.
  • [@garrettmknight] 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 Nov 1, 2023
@garrettmknight
Copy link
Contributor

Summarizing payments for this issue:

Upwork job: https://www.upwork.com/jobs/~0110cb0187ff6d5cbd

@garrettmknight
Copy link
Contributor

@parasharrajat please submit payment once you've completed the checklist

@parasharrajat
Copy link
Member

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:

Regression Test Steps

  1. Create a task
  2. Send two messages on the task report.
  3. Mark as Unread the second message
  4. Delete the first message
  5. Verify that only one marker (unread maker ) appear

Do you agree 👍 or 👎 ?

@garrettmknight garrettmknight added Weekly KSv2 and removed Daily KSv2 labels Nov 3, 2023
@parasharrajat
Copy link
Member

Payment requested as per #24648 (comment)

@JmillsExpensify
Copy link

$1,000 payment approved for @parasharrajat based on summary above.

@garrettmknight
Copy link
Contributor

Closing

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

No branches or pull requests

9 participants