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

[$1000] Web - The invite message disappears if resized the window screen for copy pasted message #20929

Closed
1 of 6 tasks
kbecciv opened this issue Jun 16, 2023 · 35 comments
Closed
1 of 6 tasks
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 Monthly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jun 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. Go to staging dot on web chrome and go to any workspace
  2. Go to invite members and on the invite message field, copy paste a long message multiple times
  3. Now resize the screen to the small screen and notice that the message you copy pasted earlier disappears and the default message is shown
  4. Now on the small screen only, copy paste a long message again and maximize the windows size to full screen
  5. This time also, notice that the copy pasted texts disappeared when you switched to a larger screen

Expected Result:

The invite message should not disappear if resized the window screen for copy pasted message

Actual Result:

The invite message disappears if resized the window screen for copy pasted message
Platforms: web chrome

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

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

error-2023-06-10_11.01.32.1.mp4
Recording.731.mp4

Expensify/Expensify Issue URL:

Issue reported by: @priya-zha

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686374637223249

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0130acef183c3013c6
  • Upwork Job ID: 1671582870354886656
  • Last Price Increase: 2024-01-03
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 16, 2023
@melvin-bot
Copy link

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

@dummy-1111
Copy link
Contributor

dummy-1111 commented Jun 16, 2023

Proposal

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

Invite message disappears when window resizes

What is the root cause of that problem?

The root cause is as in here. Remounting is the reason.
#20522 (comment)

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

We can use the inbuilt function of the form.

  1. Add shouldSaveDraft props to the TextInput here

    <TextInput
    ref={(el) => (this.welcomeMessageInputRef = el)}
    inputID="welcomeMessage"
    label={this.props.translate('workspace.inviteMessage.personalMessagePrompt')}
    autoCompleteType="off"
    autoCorrect={false}
    autoGrowHeight
    textAlignVertical="top"
    containerStyles={[styles.autoGrowHeightMultilineInput]}
    defaultValue={this.state.welcomeNote}
    value={this.state.welcomeNote}
    onChangeText={(text) => this.setState({welcomeNote: text})}
    />

  2. To initialize the state with draft value, get draftValues from onyx store with the following code above this line

        draftValues: {
            key: () => `${ONYXKEYS.FORMS.WORKSPACE_INVITE_MESSAGE_FORM}Draft`
        },

Initialize the state with draft here

            welcomeNote: _.get(props, ['draftValues', 'welcomeMessage'], this.getDefaultWelcomeNote()),
  1. Clear the draft values on submit here
        FormActions.clearDraftValues(ONYXKEYS.FORMS.WORKSPACE_INVITE_MESSAGE_FORM);

clearDraftValue function is as follows in FormActions.js

function clearDraftValues(formID) {
    Onyx.set(`${formID}Draft`, null);
}

This works as expected

Result
20929_mac_chrome.mp4

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jun 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

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

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Jun 21, 2023
@melvin-bot melvin-bot bot changed the title Web - The invite message disappears if resized the window screen for copy pasted message [$1000] Web - The invite message disappears if resized the window screen for copy pasted message Jun 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0130acef183c3013c6

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

melvin-bot bot commented Jun 21, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

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

@adelekennedy
Copy link

reproduced on staging

@melvin-bot melvin-bot bot removed the Overdue label Jun 21, 2023
@rain2o
Copy link
Contributor

rain2o commented Jun 22, 2023

Proposal

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

Any changes to the default invite message are lost when the screen size changes between mobile (small) and desktop (large) breakpoints.

What is the root cause of that problem?

This is a result of how the app handles layouts. As described in contributingGuides/NAVIGATION.md:

The wide and narrow layouts are conditionally rendered with different components in createResponsiveNavigator depending on screen size (isSmallScreen prop from the withWindowDimension.js).

All components within these layouts are unmounted/remounted when changing screen size between these specific breakpoints. The behavior described in the bug report is present in any input components that don't store the value in Onyx on change.

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

To be honest, I don't believe this would be considered a bug. Either that or it's an app-wide bug that impacts practically all components. I don't see this scenario being very common for typical users, so it seems like an edge case that will need to be handled as needed.

What alternative solutions did you explore? (Optional)

IF we decide this is a bug and we want to handle this per component, starting with the invite message component, then we would need to add welcomeNote to Onyx and update it onChange in the TextInput component.

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@adelekennedy
Copy link

@abdulrahuman5196 any thoughts on the proposal above?

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Jun 26, 2023

Thanks for the ping @adelekennedy. It seems to be an annoying bug.

@s-alves10 @rain2o
Both rootcause is correct, the changes mentioned is almost same. I think saving in the onyx should be good.

But Form component itself has inbuilt mechanism to store input values in onyx. Could you kindly check if its possible to use the same and update the proposals?
Ref: https://github.com/Expensify/App/blob/main/contributingGuides/FORMS.md#form-drafts

@dummy-1111
Copy link
Contributor

dummy-1111 commented Jun 26, 2023

Proposal

Updated

@abdulrahuman5196
Video demo was attached as well.

@melvin-bot
Copy link

melvin-bot bot commented Jun 28, 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 Jun 28, 2023
@abdulrahuman5196
Copy link
Contributor

Thank you for the updated proposal @s-alves10 , I will check if its working and update in a day.

@melvin-bot melvin-bot bot removed the Overdue label Jun 28, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 26, 2023
@adelekennedy
Copy link

on hold

@melvin-bot melvin-bot bot removed the Overdue label Jul 26, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 4, 2023
@adelekennedy
Copy link

still holding - moving to monthly

@melvin-bot melvin-bot bot removed the Overdue label Aug 7, 2023
@adelekennedy adelekennedy added Monthly KSv2 and removed Weekly KSv2 labels Aug 7, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 11, 2023
@adelekennedy
Copy link

still holding

@melvin-bot melvin-bot bot removed the Overdue label Sep 12, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 13, 2023
@adelekennedy
Copy link

still on hold

@melvin-bot melvin-bot bot removed the Overdue label Oct 13, 2023
@melvin-bot melvin-bot bot added the Overdue label Nov 14, 2023
@adelekennedy
Copy link

#20404 is now closed - @abdulrahuman5196 can we move this one forward or are their linked issues I should be clocking as well?

@melvin-bot melvin-bot bot removed the Overdue label Nov 14, 2023
@abdulrahuman5196
Copy link
Contributor

Seems long time since this issue was held on hold. Will check and update

@abdulrahuman5196
Copy link
Contributor

Can we remove hold, so that we can re-test the issue?

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@adelekennedy
Copy link

ah sorry @abdulrahuman5196 I never saw this comment! Updating

@melvin-bot melvin-bot bot removed the Overdue label Dec 19, 2023
@adelekennedy adelekennedy changed the title [HOLD for #20404] [$1000] Web - The invite message disappears if resized the window screen for copy pasted message [$1000] Web - The invite message disappears if resized the window screen for copy pasted message Dec 19, 2023
Copy link

melvin-bot bot commented Dec 20, 2023

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

@dummy-1111
Copy link
Contributor

I wasn't able to reproduce the issue. I think we can close this

Copy link

melvin-bot bot commented Dec 27, 2023

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

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

Copy link

melvin-bot bot commented Jan 3, 2024

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

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 Monthly KSv2
Projects
No open projects
Development

No branches or pull requests

7 participants