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

[$250] [Android] mWeb/Chrome - BNP - Inserting decimal point, inconsistent behavior in mweb&Android #47074

Open
1 of 6 tasks
IuliiaHerets opened this issue Aug 8, 2024 · 28 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Overdue

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 8, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.18
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4836262
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch app in both mweb and Android
  2. Tap fab -- submit expense
  3. Enter 23 and keep cursor between 2&3 and type dot to insert decimal point
  4. Note the behavior in mweb & Android

Expected Result:

Inserting decimal point, behavior must be consistent in mweb& Android.

Actual Result:

In Android, decimal point is inserted correctly in the same place but in mweb, decimal point is inserted after a number. Inserting decimal point, inconsistent behavior in mweb& Android.

Workaround:

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

Platforms:

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

Screenshots/Videos

Bug6565332_1723101158572.Screenrecorder-2024-08-08-12-34-45-180_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021846593217215177350
  • Upwork Job ID: 1846593217215177350
  • Last Price Increase: 2024-10-16
Issue OwnerCurrent Issue Owner: @thesahindia
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 8, 2024
Copy link

melvin-bot bot commented Aug 8, 2024

Triggered auto assignment to @mallenexpensify (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.

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #vip-vsb

@IuliiaHerets
Copy link
Author

@mallenexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@IuliiaHerets IuliiaHerets changed the title BNP-Inserting decimal point, inconsistent behavior in mweb& Android mWeb/Chrome - BNP - Inserting decimal point, inconsistent behavior in mweb&Android Aug 8, 2024
@mallenexpensify mallenexpensify added Weekly KSv2 Needs Reproduction Reproducible steps needed and removed Daily KSv2 labels Aug 9, 2024
@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@mallenexpensify
Copy link
Contributor

Gonna try to pawn this off on Sheena when she gets assigned another iOS bug :)

@melvin-bot melvin-bot bot added the Overdue label Aug 19, 2024
@mallenexpensify
Copy link
Contributor

Oh snap.... we got an Android phone on the way to the bank! I'll be able to test soon.

@melvin-bot melvin-bot bot removed the Overdue label Aug 21, 2024
Copy link

melvin-bot bot commented Aug 22, 2024

@mallenexpensify this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@mallenexpensify mallenexpensify changed the title mWeb/Chrome - BNP - Inserting decimal point, inconsistent behavior in mweb&Android [Android] mWeb/Chrome - BNP - Inserting decimal point, inconsistent behavior in mweb&Android Aug 26, 2024
@melvin-bot melvin-bot bot added the Overdue label Aug 29, 2024
@mallenexpensify mallenexpensify added Daily KSv2 and removed Weekly KSv2 labels Aug 31, 2024
@melvin-bot melvin-bot bot removed the Overdue label Aug 31, 2024
@mallenexpensify
Copy link
Contributor

Need to get Android phone setup, will do next week, bumped to Daily

@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
@mallenexpensify
Copy link
Contributor

Unsure when in the office this week but planning to get phone setup

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 3, 2024
Copy link

melvin-bot bot commented Sep 6, 2024

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

@mallenexpensify
Copy link
Contributor

Still need to get phone setup 😿

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 7, 2024
@melvin-bot melvin-bot bot removed the Overdue label Sep 24, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2024
@mallenexpensify
Copy link
Contributor

Waiting on retest

@melvin-bot melvin-bot bot removed the Overdue label Oct 9, 2024
@mvtglobally
Copy link

Issue is reproducible during KI retests.

1728711736643.Screenrecorder-2024-10-12-11-11-24-818_compress_1.mp4

@mvtglobally mvtglobally removed the retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause label Oct 14, 2024
@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Oct 16, 2024
Copy link

melvin-bot bot commented Oct 16, 2024

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

@melvin-bot melvin-bot bot changed the title [Android] mWeb/Chrome - BNP - Inserting decimal point, inconsistent behavior in mweb&Android [$250] [Android] mWeb/Chrome - BNP - Inserting decimal point, inconsistent behavior in mweb&Android Oct 16, 2024
@mallenexpensify mallenexpensify removed the Needs Reproduction Reproducible steps needed label Oct 16, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 16, 2024
Copy link

melvin-bot bot commented Oct 16, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 16, 2024
@mallenexpensify
Copy link
Contributor

Wow.. I really kicked the can down the road for a while here :/
Got Android phone setup and tested both on web and native, def a bug on mWeb where decimal goes to the end instead of the being placed in the middle where the cursor is.

@rezkiy37
Copy link
Contributor

Hi, I am Michael (Mykhailo) from Callstack, an expert agency and I can work on this issue.

@rezkiy37
Copy link
Contributor

The bug is replicable on all mobile web. I am investigating.

Details

Bug.mp4

@melvin-bot melvin-bot bot added Overdue and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 19, 2024
@rezkiy37
Copy link
Contributor

No overdue. I am working on the issue.

@rezkiy37
Copy link
Contributor

I understand why the bug exists. The app does not recognize a cursor change for this edge case, and the callback of onSelectionChange is not called. Working on some fix.

Copy link

melvin-bot bot commented Oct 21, 2024

@mallenexpensify, @rezkiy37, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick!

@rezkiy37
Copy link
Contributor

Since the bug is web-only we can utilize onPress (onClick) to get the latest selection. Preparing a proposal.

@rezkiy37
Copy link
Contributor

Proposal

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

When the user clicks on the "<" (remove) button in mWeb, any further input is inserted in a previous selection (cursor) position. For instance:

  1. Enter 234.
  2. Set a decimal point after 2. Result: 2.34.
  3. Click on the remove button. Result: 234.
  4. Set a decimal point after 3. Expected result: 23.4 but actual result: 2.34.
Video

Bug1.mp4

What is the root cause of that problem?

The app does not recognize a cursor change for this edge case, and the callback of onSelectionChange is not called. However, the cursor position displays correctly visually.

onSelectionChange={(e: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {

Since the callback has not been called, the state is outdated.

const [selection, setSelection] = useState({
start: selectedAmountAsString.length,
end: selectedAmountAsString.length,
});

Therefore any further input is inserted in order with the outdated state.

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

The app uses BaseTextInputWithCurrencySymbol to display the input. There are platform separation for the component index.android.tsx and index.tsx. It utilizes onSelectionChange of TextInput.

I propose to create a web-specific file index.web.tsx, where I will put the next selection-specific logic:

onSelectionChange={(event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => {
    onSelectionChange(event.nativeEvent.selection.start, event.nativeEvent.selection.end);
}}
onPress={() => {
    const selectionStart = (textInputRef.current?.selectionStart as number) ?? 0;
    const selectionEnd = (textInputRef.current?.selectionEnd as number) ?? 0;
    onSelectionChange(selectionStart, selectionEnd);
}}

It utilizes one more handler — onPress — which is basically onClick on the web. The event informs the component about every click including the particular edge case. The app can take the correct selection of an input ref and update the internal state. Therefore any further input is inserted correctly.

Video

No.bug.mp4

What alternative solutions did you explore? (Optional)

N/A

Copy link

melvin-bot bot commented Oct 23, 2024

@mallenexpensify, @rezkiy37, @thesahindia Eep! 4 days overdue now. Issues have feelings too...

@mallenexpensify
Copy link
Contributor

@thesahindia can you review the above proposal plz? thx

Copy link

melvin-bot bot commented Oct 25, 2024

@mallenexpensify, @rezkiy37, @thesahindia 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

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

No branches or pull requests

6 participants