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 2021-12-15] “Cannot remove yourself from workspace” banner is shown over and over again while inviting a new member - Reported by: @aswin-s #6287

Closed
isagoico opened this issue Nov 12, 2021 · 15 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@isagoico
Copy link

isagoico commented Nov 12, 2021

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. Navigate to add member screen
  2. Tap on check box against own account once.
  3. Now tap on invite button to invite a new member
  4. The banner keeps on popping up.
  5. Even sending app to background and resuming or swiping down from notification panel also shows same behaviour.

Expected Result:

Banner notifying the user that own account can't be removed from workspace should show only one.

Actual Result:

Banner keeps showing up after clicking on invite button.

Workaround:

Force closing and reopening the app fixes the issue.

Platform:

Where is this issue occurring?

  • iOS
  • Android
  • Mobile Web

Version Number: 1.1.14-0

Reproducible in staging?: Yes
Reproducible in production?: Yes

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

RPReplay_Final1636709392.MP4

Upwork job post: https://www.upwork.com/jobs/~01a1b16b70fceaf5f1

Issue reported by: @aswin-s
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1636709473156600

View all open jobs on GitHub

@MelvinBot
Copy link

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

@akshayasalvi
Copy link
Contributor

For some reason, I am not able to reproduce this by following the given reproduction steps. I am unable to click the own admin checkbox itself. It shows the following tooltip. @isagoico Can you help with some clarity on the reproduction steps?

image

@isagoico
Copy link
Author

My bad! I just updated the platforms affected. This is only reproducible in mobile.

@sketchydroide
Copy link
Contributor

Thanks @isagoico.

This definetly sounds like a bug, specialy for being platform specific. Also setting this as an external.

@MelvinBot MelvinBot removed the Overdue label Nov 15, 2021
@sketchydroide sketchydroide added the External Added to denote the issue can be worked on by a contributor label Nov 15, 2021
@MelvinBot
Copy link

Triggered auto assignment to @michaelhaxhiu (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@PrashantMangukiya
Copy link
Contributor

Proposed Solution:

Here is the Problem: It is calling componentDidUpdate() method when goes to background.

componentDidUpdate() {
if (!this.props.toggleTooltip) {
return;
}
Growl.show(this.props.text, this.props.growlType, 3000);
}

Solution: Put condition at line 19 i.e. If toggleTooltip change run Growl, otherwise not. This will correct the issue.

componentDidUpdate(prevProps) {
    if (!this.props.toggleTooltip) {
        return;
    }

    if (prevProps.toggleTooltip !== this.props.toggleTooltip) {
        Growl.show(this.props.text, this.props.growlType, 3000);
    }
}

Here is screen record, it works as expected with this solution:

iOS

iOS.mov

Android

Android.mp4

Mobile Web

MobileWeb.mov

@developvsn
Copy link
Contributor

developvsn commented Nov 15, 2021

Proposal

This bug is occurring because in willTooltipShowForLogin function, in case when workspace owner wants to remove himself, this code this.setState({showTooltipForLogin: login}); allows to show popUp, but showTooltipForLogin state variable's value will be always login and popup will be shown over and over again.

if (!canBeRemoved) {
this.setState({showTooltipForLogin: login});
}

The simpest way to fix it is to set showTooltipForLogin variable value " " after popUp was shown first time, like this:

if (!canBeRemoved) {
            this.setState({showTooltipForLogin: login});
            setTimeout(() => this.setState({showTooltipForLogin: ''}), 100);
        }
IMG_9639.MP4
android.mp4
Mobile.web.mov

@michaelhaxhiu
Copy link
Contributor

michaelhaxhiu commented Nov 17, 2021

Upwork job post: https://www.upwork.com/jobs/~01a1b16b70fceaf5f1

  • ✅ I hired @aswin-s, so that they are paid the bug reporting bonus (i.e. if/when this bug is fixed).
  • Next, I'll hire the contributor we choose to actually solve the problem. Looks like @PrashantMangukiya's proposal is the first to review.

We should have 2 hires for this job basically.

@MelvinBot MelvinBot removed the Overdue label Nov 17, 2021
@botify botify removed the Daily KSv2 label Nov 17, 2021
@MelvinBot MelvinBot added Weekly KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors labels Nov 17, 2021
@MelvinBot
Copy link

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

@johnmlee101
Copy link
Contributor

@PrashantMangukiya I like your proposal! #6287 (comment) let's go with that.

@MelvinBot
Copy link

📣 @PrashantMangukiya You have been assigned to this job by @johnmlee101!
Please apply to this job in Upwork and let us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@MelvinBot MelvinBot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 30, 2021
@michaelhaxhiu
Copy link
Contributor

Next, I'll hire the contributor we choose to actually solve the problem. Looks like @PrashantMangukiya's proposal is the first to review.

Done ✅ - @PrashantMangukiya you are hired on Upwork.

@PrashantMangukiya
Copy link
Contributor

Thanks @michaelhaxhiu Preparing pr now and submit asap.

@botify
Copy link

botify commented Dec 8, 2021

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.18-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 2021-12-15. 🎊

@botify botify changed the title “Cannot remove yourself from workspace” banner is shown over and over again while inviting a new member - Reported by: @aswin-s [HOLD for payment 2021-12-15] “Cannot remove yourself from workspace” banner is shown over and over again while inviting a new member - Reported by: @aswin-s Dec 8, 2021
@michaelhaxhiu
Copy link
Contributor

Both contributors are 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 Engineering 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