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 2024-07-05] [$500] [CRITICAL] [UX Reliability] Long pressing the comment reaction does not open the reactions modal the first time you do it #43169

Closed
1 of 6 tasks
mountiny opened this issue Jun 6, 2024 · 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 Jun 6, 2024

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


Version Number: 1.4.80-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
Expensify/Expensify Issue URL:
Issue reported by: @mountiny
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1717678892330039?thread_ts=1717676956.216859&cid=C049HHMV9SM

Action Performed:

Break down in numbered steps

  1. Using iOS native
  2. Open a chat with comments that have reactions on it
  3. Long press the emoji reaction
  4. The haptic feadback signals the click
  5. Nothing happens
  6. Long press once more
  7. The modal with who posted those reactions opened

Expected Result:

Describe what you think should've happened

When you long press on the reaction, the modal with who posted those reactions should open

Actual Result:

Describe what actually happened

The first time it does not work and you only feel the haptic feedback but the click does not happen

Workaround:

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

You have to do it twice

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f70177dd3a98fd24
  • Upwork Job ID: 1798702401875246255
  • Last Price Increase: 2024-06-10
  • Automatic offers:
    • getusha | Reviewer | 102685488
    • bernhardoj | Contributor | 102685489
Issue OwnerCurrent Issue Owner: @kevinksullivan
@mountiny mountiny added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 6, 2024
@mountiny mountiny self-assigned this Jun 6, 2024
@melvin-bot melvin-bot bot changed the title [CRITICAL] [UX Reliability] Long pressing the comment reaction does not open the reactions modal the first time you do it [$250] [CRITICAL] [UX Reliability] Long pressing the comment reaction does not open the reactions modal the first time you do it Jun 6, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 6, 2024
@mountiny mountiny moved this to CRITICAL in [#whatsnext] #quality Jun 6, 2024
Copy link

melvin-bot bot commented Jun 6, 2024

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

Copy link

melvin-bot bot commented Jun 6, 2024

Triggered auto assignment to @kevinksullivan (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@mountiny
Copy link
Contributor Author

mountiny commented Jun 6, 2024

RPReplay_Final1717682080.MP4

its not really that visible in the video, but I do long press on the heart once and nothing happens

@bernhardoj
Copy link
Contributor

bernhardoj commented Jun 6, 2024

Proposal

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

We need to long press the emoji reaction twice to open it.

What is the root cause of that problem?

When we long press, it will call this function.

const showReactionList: ReactionListRef['showReactionList'] = (event, reactionListAnchor, emojiName, reportActionID) => {
setReactionListReportActionID(reportActionID);
setReactionListEmojiName(emojiName);
innerReactionListRef.current?.showReactionList(event, reactionListAnchor);
};

The issue here is that the innerReactionListRef is null the first time we do a long press. That's because we render nothing when reactionListReportActionID or reactionListEmojiName is empty.

if (reactionListReportActionID === '' || reactionListEmojiName === '') {
return null;
}
return (
<BasePopoverReactionList
ref={innerReactionListRef}
reportActionID={reactionListReportActionID}
emojiName={reactionListEmojiName}
/>
);

Both of those states will be set when we do the long press. That's why the reaction list shows when we long press it the 2nd time because both of those states is already set on the first long press.

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

Don't render null and let the popover component be rendered. So, let's remove this code.

if (reactionListReportActionID === '' || reactionListEmojiName === '') {
return null;
}

That code was added in this TS PR migration.

And to be safe, we can make sure the popover isn't visible when the emoji name or report action ID is empty.

return (
<PopoverWithMeasuredContent
isVisible={isPopoverVisible}

isVisible={isPopoverVisible && !!reportActionID && !!emojiName}

or we can just return null here too when they are empty

@WojtekBoman
Copy link
Contributor

Hi! I'm going to work on that :)

@mountiny
Copy link
Contributor Author

mountiny commented Jun 6, 2024

@WojtekBoman can you please review the proposal from @bernhardoj and if the RCA/ solution makes sense, they can implement the PR

@ShridharGoel
Copy link
Contributor

ShridharGoel commented Jun 6, 2024

Proposal

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

Long pressing the comment reaction does not open the reactions modal the first time you do it.

What is the root cause of that problem?

This happens because we are setting reactionListReportActionID and reactionListEmojiName with state updates with are async, because of which innerReactionListRef.current is accessed while it still has a null value.

const showReactionList: ReactionListRef['showReactionList'] = (event, reactionListAnchor, emojiName, reportActionID) => {
setReactionListReportActionID(reportActionID);
setReactionListEmojiName(emojiName);
innerReactionListRef.current?.showReactionList(event, reactionListAnchor);
};

The below condition is true, which leads to nothing rendering:

if (reactionListReportActionID === '' || reactionListEmojiName === '') {
return null;
}

This makes innerReactionListRef.current null and we don't see the reaction list opening.

On the second try, innerReactionListRef.current is no longer null, hence the list opens.

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

We can add some new states and update the showReactionList method as below:

const [isReady, setIsReady] = useState(false);
const [event, setEvent] = useState<ReactionListEvent | undefined>();
const [reactionListAnchor, setReactionListAnchor] = useState<ReactionListAnchor>();

const showReactionList: ReactionListRef['showReactionList'] = (event, reactionListAnchor, emojiName, reportActionID) => {
    setReactionListReportActionID(reportActionID);
    setReactionListEmojiName(emojiName);
    setEvent(event)
    setIsReady(true);
    setReactionListAnchor(reactionListAnchor)
};

Then, we can add a useEffect:

useEffect(() => {
    if (isReady) {
        innerReactionListRef.current?.showReactionList(event, reactionListAnchor);
    }
}, [isReady, event, reactionListAnchor]);

@ShridharGoel
Copy link
Contributor

@mountiny @WojtekBoman I was also working on a proposal, which I have posted above.

@ShridharGoel
Copy link
Contributor

if (reactionListReportActionID === '' || reactionListEmojiName === '') {
    return null;
}

This existing check ensures that the popover doesn't open if reactionListReportActionID or reactionListEmojiName is passed as empty. If we remove this check, then the popover will open with a kind of empty state if one of the above values is not available.

@WojtekBoman
Copy link
Contributor

WojtekBoman commented Jun 6, 2024

@bernhardoj Your proposal makes sense to me :)

This if statement was actually added here and wasn't present in the .js file.

if (reactionListReportActionID === '' || reactionListEmojiName === '') {
    return null;
}

This existing check ensures that the popover doesn't open if reactionListReportActionID or reactionListEmojiName is passed as empty. If we remove this check, then the popover will open with a kind of empty state if one of the above values is not available.

@ShridharGoel Is it possible to trigger opening the popover with empty values? If so, I believe that it should be secured at a different level that doesn't affect innerReactionListRef value.

@ShridharGoel
Copy link
Contributor

Is it possible to trigger opening the popover with empty values? If so, I believe that it should be secured at a different level that doesn't affect innerReactionListRef value.

That can happen if the emoji name is not available for an emoji.

@WojtekBoman
Copy link
Contributor

That can happen if the emoji name is not available for an emoji.

I'm not sure if the emoji name might be unavailable but if so we should move this checking logic elsewhere to fix innerReactionListRef.

@mountiny
Copy link
Contributor Author

mountiny commented Jun 6, 2024

@getusha can you please review the proposals also given @WojtekBoman feedback? thanks

@getusha

This comment was marked as outdated.

@bernhardoj
Copy link
Contributor

I don't know if it's possible for an emoji to not have a name, but I have updated my proposal to not show the list when the name is empty.

@getusha
Copy link
Contributor

getusha commented Jun 7, 2024

I don't think the root cause is correct @bernhardoj, the TS migration PR was merged 5 months ago and i am pretty sure this issue wasn't present while testing.

@mountiny mountiny changed the title [$250] [CRITICAL] [UX Reliability] Long pressing the comment reaction does not open the reactions modal the first time you do it [$500] [CRITICAL] [UX Reliability] Long pressing the comment reaction does not open the reactions modal the first time you do it Jun 10, 2024
@melvin-bot melvin-bot bot added the Overdue label Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 2024

Upwork job price has been updated to $500

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jul 4, 2024
Copy link

melvin-bot bot commented Jul 4, 2024

This issue has not been updated in over 15 days. @kevinksullivan, @mountiny, @bernhardoj, @getusha 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!

@mountiny mountiny changed the title [$500] [CRITICAL] [UX Reliability] Long pressing the comment reaction does not open the reactions modal the first time you do it [HOLD for payment 2024-07-05] [$500] [CRITICAL] [UX Reliability] Long pressing the comment reaction does not open the reactions modal the first time you do it Jul 4, 2024
@mountiny mountiny added Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review Monthly KSv2 labels Jul 4, 2024
@mountiny
Copy link
Contributor Author

mountiny commented Jul 4, 2024

@kevinksullivan this is ready for payment

$500 to @getusha and to @bernhardoj

@bernhardoj
Copy link
Contributor

@mountiny @kevinksullivan I recently set up a payment to get paid in ND, what should be the process? Should I submit the request in ND and comment here when I did?

@mountiny
Copy link
Contributor Author

mountiny commented Jul 5, 2024

Yeah I believe that is the process, in the request you should link to the correct issue

@bernhardoj
Copy link
Contributor

Thanks! Requested in ND.

@melvin-bot melvin-bot bot added the Overdue label Jul 8, 2024
@JmillsExpensify
Copy link

$500 approved for @bernhardoj

Copy link

melvin-bot bot commented Jul 8, 2024

@kevinksullivan, @mountiny, @bernhardoj, @getusha Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Jul 10, 2024

@kevinksullivan, @mountiny, @bernhardoj, @getusha Eep! 4 days overdue now. Issues have feelings too...

@mountiny
Copy link
Contributor Author

@getusha Have you been paid for this task?

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Daily KSv2 Overdue labels Jul 11, 2024
@getusha
Copy link
Contributor

getusha commented Jul 15, 2024

Not yet @mountiny, working on the checklist.

@kevinksullivan
Copy link
Contributor

Here's the summary:

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jul 15, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

@kevinksullivan, @mountiny, @bernhardoj, @getusha Whoops! This issue is 2 days overdue. Let's get this updated quick!

@mountiny
Copy link
Contributor Author

Both to be paid in NewDot so I think we can close this. no regression steps required as its quite specific issue

@melvin-bot melvin-bot bot removed the Overdue label Jul 19, 2024
@JmillsExpensify
Copy link

$500 approved for @getusha

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
Development

No branches or pull requests

8 participants