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 #21977 [$1000] When an anonymous user copies a message, the app says "Copied", but it DOES NOT actually copy the message #22307

Closed
1 of 6 tasks
kavimuru opened this issue Jul 5, 2023 · 18 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. 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 Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jul 5, 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. Logout current user or open web app in private mode
  2. Open any room as an anonymous user. SNH room for example: https://staging.new.expensify.com/r/5303403427249671
  3. HOVER on any message and select “Copy to clipboard” option. Observer that:
  • The app shows “Copied” - but it DOES NOT actually copy the message
  • User is re-directed to login page

Expected Result:

The message should be actually copied (not just shown “Copied” label)

Actual Result:

The app says "Copied", but it DOES NOT actually copy the message and then redirects the user to the login page.

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

Copy-message.mp4

Expensify/Expensify Issue URL:
Issue reported by: @tranvantoan-qn
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688384968610059

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~011eb534d2568f9e9b
  • Upwork Job ID: 1676700818736766976
  • Last Price Increase: 2023-08-02
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 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 Jul 5, 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 Jul 5, 2023
@melvin-bot melvin-bot bot changed the title When an anonymous user copies a message, the app says "Copied", but it DOES NOT actually copy the message [$1000] When an anonymous user copies a message, the app says "Copied", but it DOES NOT actually copy the message Jul 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

Job added to Upwork: https://www.upwork.com/jobs/~011eb534d2568f9e9b

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

melvin-bot bot commented Jul 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

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

@samh-nl
Copy link
Contributor

samh-nl commented Jul 5, 2023

Proposal

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

The Copy to clipboard option does not actually copy in the case of an anonymous user.

What is the root cause of that problem?

The onPress event is handled by interceptAnonymousUser, which ignores the callback if the user is anonymous. Furthermore, it leads to the user being redirected to the sign in page.

onPress={() => interceptAnonymousUser(() => contextAction.onPress(closePopup, payload))}

const interceptAnonymousUser = (callback) => {
if (Session.isAnonymousUser()) {
hideContextMenu(false);
InteractionManager.runAfterInteractions(() => {
Session.signOutAndRedirectToSignIn();
});
} else {
callback();
}
};

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

In order to achieve the expected result, which is to copy the message and not redirect to the signin page, we can modify the contextAction and add an extra value called shouldInterceptAnonymousUser.

We can then conditionally ignore the callback if this value is true.

const interceptAnonymousUser = (callback, shouldInterceptAnonymousUser) => {
    if (Session.isAnonymousUser() && shouldInterceptAnonymousUser) {

What alternative solutions did you explore? (Optional)

Option 1: We can expand Session.checkIfActionIsAllowed and add 3 arguments to make it compatible with the user case here:

  • shouldRunAfterInteractions
  • hideContextMenu
  • isAnonymousAllowed

This gives a general solution that can also be applied elsewhere, such as:

toggleReaction={(emoji) => {
if (Session.isAnonymousUser()) {
hideContextMenu(false);
InteractionManager.runAfterInteractions(() => {
Session.signOutAndRedirectToSignIn();
});
} else {
toggleReaction(emoji);
}
}}

Option 2: we can incorporate the condition in the onPress event, however this is slightly less readable code.

@AdekolaThanni
Copy link

Proposal

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

The copy to clipboard does not copy text for anonymous user although it sends a copied signal before logging client out.

What is the root cause of that problem?

The onPressAction triggers the interceptAnonymousUser which blocks the anonymous user from copying text to clipboard and then leading to a sign out.

onPress={() => interceptAnonymousUser(() => contextAction.onPress(closePopup, payload))}

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

The change we can make in order to allow a user to copy text to the clipboard directly since we have no aim of signing them out if they are an anonymous user is to remove the actionless code of passing interceptAnonymousUser to the onPress function, instead, we pass the callback directly. Such as this

onPress={() => contextAction.onPress(closePopup, payload)}

What alternative solutions did you explore? (Optional)

None

@yh-0218
Copy link
Contributor

yh-0218 commented Jul 6, 2023

Proposal

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

The app says "Copied", but it DOES NOT actually copy the message and then redirects the user to the login page.

What is the root cause of that problem?

We need to allow only "Copy" for AnonymousUser. not allow others like "Reply" and "Reaction"
The root cause of this problem is that "AnonymousUser" is redirected to "Signin Page" when click copy.

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

We need to add a flag to "Copy" of ContextMenuActions to allow for "AnonymousUser" to copy text.
So we can make if user allow "copy" without "signin" and not allow "reply" without "signin".

Screen.Recording.2023-07-06.at.11.28.59.PM.mov

What alternative solutions did you explore? (Optional)

@Santhosh-Sellavel
Copy link
Collaborator

@adelekennedy Please add a HOLD label here to the issue, we are working on fixing this holistically on #21977.

@adelekennedy adelekennedy changed the title [$1000] When an anonymous user copies a message, the app says "Copied", but it DOES NOT actually copy the message HOLD for #21977 [$1000] When an anonymous user copies a message, the app says "Copied", but it DOES NOT actually copy the message Jul 7, 2023
@adelekennedy adelekennedy added Weekly KSv2 and removed Daily KSv2 labels Jul 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 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 Jul 17, 2023
@adelekennedy
Copy link

still holding on this

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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

1 similar comment
@melvin-bot
Copy link

melvin-bot bot commented Jul 26, 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 Jul 26, 2023
@adelekennedy
Copy link

hold

@melvin-bot melvin-bot bot removed the Overdue label Jul 26, 2023
@PauloGasparSv
Copy link
Contributor

Hey @adelekennedy @Santhosh-Sellavel sorry for the delay, I was OOO and got back this week : )

The fix from #21977 worked and now the copy button is working fine for anonymous users!

Screen.Recording.2023-08-01.at.18.48.52.mov

I'm not sure if we need to compensate who reported this first but please feel free to close this!

@adelekennedy
Copy link

Thank you!

Payment Summary

@tranvantoan-qn - $250 for reporting bonus (paid via Upwork)

In this case I think only the reporting bonus is due because we put this on hold so quickly.

@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

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

@adelekennedy
Copy link

reporting paid out. closing this!

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. 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 Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants