You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-03-30] Odometer - User can input any character in the Odometer input field #84220
Version Number: v9.3.31-1 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#78291 Email or phone of affected tester (no customers):applausetester+ds@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 14.5/ Chrome App Component: Other
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #83170 - "Add frontend validation for distance expense amounts exceeding backend limit (v2)" by @neildotexpensify (High confidence) Related Issues: None
Recommendation: ROLL FORWARD
The bug is straightforward to fix - the input handlers need to normalize/clean the text before setting it to state. Rolling forward with a fix is simpler than reverting PR #83170, which added important validation logic to prevent backend errors.
Labels: No label changes needed - this is correctly labeled as DeployBlockerCash (App deploy blocker)
Detailed Analysis
Evidence
PR #83170 refactored the odometer input validation logic, replacing the cleanOdometerReading() function with isOdometerInputValid(). This change introduced a critical bug:
Before (working):
consthandleStartReadingChange=(text: string)=>{constcleaned=cleanOdometerReading(text);// Strips invalid characterssetStartReading(cleaned);// Sets the cleaned value}
After (broken):
consthandleStartReadingChange=(text: string)=>{if(!isOdometerInputValid(text,startReading)){return;}setStartReading(text);// BUG: Sets raw text, not cleaned!}
Verification
The bug is in /home/runner/_work/App/App/src/pages/iou/request/step/IOURequestStepDistanceOdometer.tsx lines 305-323
The isOdometerInputValid function validates the NORMALIZED text (via DistanceRequestUtils.normalizeOdometerText) but doesn't clean the input before it's set to state
Result: When a user types "abc123", the validation normalizes it to "123" which passes validation, then sets "abc123" to state, displaying the letters in the input field
Root Cause
The refactoring separated validation from cleaning. isOdometerInputValid only checks if the normalized text is valid, but handleStartReadingChange and handleEndReadingChange set the raw input text instead of the normalized version.
Fix Required
In IOURequestStepDistanceOdometer.tsx, the handlers should normalize the text before setting it:
consthandleStartReadingChange=(text: string)=>{if(!isOdometerInputValid(text,startReading)){return;}constnormalized=DistanceRequestUtils.normalizeOdometerText(text,fromLocaleDigit);setStartReading(normalized);// Set normalized textif(formError){setFormError(''<empty>);}};
Melvin-bot initially assigned this to PR #78291, but that PR only refactored the DiscardChangesConfirmation component and didn't touch the input validation logic. PR #78291 merged after PR #83170 had already introduced the bug.
Please re-state the problem that we are trying to solve in this issue.
The odometer input field (start/end reading) in the "Track Distance > Odometer" flow accepts any character (letters, symbols, etc.) instead of restricting input to numeric values only. Users can type "abc" or any non-numeric string into the odometer fields on web/desktop.
What is the root cause of that problem?
The handleStartReadingChange and handleEndReadingChange functions in IOURequestStepDistanceOdometer.tsx call isOdometerInputValid() to validate input, but this function validates the normalized (stripped) text rather than the raw input text.
The validation flow works like this:
User types a character (e.g., "a") making the input "123a"
isOdometerInputValid("123a", "123") is called
Inside, normalizeOdometerText("123a") strips non-numeric characters via /[^0-9.]/g, producing "123"
Validation checks run against "123" — which passes
setStartReading("123a") stores the raw text (including the "a") in state
The TextInput displays "123a"
The inputMode={CONST.INPUT_MODE.DECIMAL} and keyboardType={CONST.KEYBOARD_TYPE.DECIMAL_PAD} props on the TextInput only affect the mobile virtual keyboard layout — they do not filter characters on web/desktop where a physical keyboard is used.
This is in contrast to other numeric inputs in the codebase (e.g., validateAmount in MoneyRequestUtils.ts) which validate the raw text against a strict regex like /^\d{1,N}(\.\d{0,N})?$/ to reject non-numeric keystrokes.
What changes do you think we should make in order to solve the problem?
In handleStartReadingChange and handleEndReadingChange in IOURequestStepDistanceOdometer.tsx, add a check that rejects the raw input if it contains non-numeric characters (digits and locale decimal separator only). This should be done before the existing isOdometerInputValid call.
The simplest approach: normalize the text first and store the normalized result instead of the raw text. Modify both handlers to run the text through normalizeOdometerText (or an equivalent filter) before storing it in state via setStartReading/setEndReading. This way, non-numeric characters are stripped at keystroke time, not just at submit time.
Alternatively, add a raw-text regex check (similar to validateAmount) that returns early if the raw text contains anything other than digits and the locale decimal separator.
What alternative solutions did you explore? (Optional)
An alternative would be using an HTML pattern attribute or type="number" on the underlying <input> element for web. However, this would require platform-specific changes to the TextInput component and is less consistent with the existing codebase pattern where validation is handled in the change handlers.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
I think I am due payment here as well, As I already flagged the bug.
And I was reviewer for the prior PR while author for the current, It should be considered as a separate issue.
But since it's a miscellaneous case, I'd happily agree whatever @Julesssss or @neil-marcellini thinks is fair here.
It's semi related and caused a regression from the prior issue. I think it is fair to have no additional payment, as the original issue bonus wasn't halved. Please correct me if I am mistaken though.
Sounds good. I am going to pay out @ChavdaSachin's existing contract from #83507 since there is no additional payment to them here 👍 cc @mallenexpensify
Activity
melvin-bot commentedon Mar 4, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #78291
melvin-bot commentedon Mar 4, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Mar 4, 2026
Triggered auto assignment to @stephanieelliott (
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.github-actions commentedon Mar 4, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon Mar 4, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #83170 - "Add frontend validation for distance expense amounts exceeding backend limit (v2)" by @neildotexpensify (High confidence)
Related Issues: None
Recommendation: ROLL FORWARD
The bug is straightforward to fix - the input handlers need to normalize/clean the text before setting it to state. Rolling forward with a fix is simpler than reverting PR #83170, which added important validation logic to prevent backend errors.
Labels: No label changes needed - this is correctly labeled as DeployBlockerCash (App deploy blocker)
Detailed Analysis
Evidence
PR #83170 refactored the odometer input validation logic, replacing the
cleanOdometerReading()function withisOdometerInputValid(). This change introduced a critical bug:Before (working):
After (broken):
Verification
/home/runner/_work/App/App/src/pages/iou/request/step/IOURequestStepDistanceOdometer.tsxlines 305-323isOdometerInputValidfunction validates the NORMALIZED text (viaDistanceRequestUtils.normalizeOdometerText) but doesn't clean the input before it's set to stateRoot Cause
The refactoring separated validation from cleaning.
isOdometerInputValidonly checks if the normalized text is valid, buthandleStartReadingChangeandhandleEndReadingChangeset the raw input text instead of the normalized version.Fix Required
In
IOURequestStepDistanceOdometer.tsx, the handlers should normalize the text before setting it:Same fix needed for
handleEndReadingChange.Why Not PR #78291?
Melvin-bot initially assigned this to PR #78291, but that PR only refactored the
DiscardChangesConfirmationcomponent and didn't touch the input validation logic. PR #78291 merged after PR #83170 had already introduced the bug.MelvinBot commentedon Mar 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
The odometer input field (start/end reading) in the "Track Distance > Odometer" flow accepts any character (letters, symbols, etc.) instead of restricting input to numeric values only. Users can type "abc" or any non-numeric string into the odometer fields on web/desktop.
What is the root cause of that problem?
The
handleStartReadingChangeandhandleEndReadingChangefunctions inIOURequestStepDistanceOdometer.tsxcallisOdometerInputValid()to validate input, but this function validates the normalized (stripped) text rather than the raw input text.The validation flow works like this:
isOdometerInputValid("123a", "123")is callednormalizeOdometerText("123a")strips non-numeric characters via/[^0-9.]/g, producing "123"setStartReading("123a")stores the raw text (including the "a") in stateThe
inputMode={CONST.INPUT_MODE.DECIMAL}andkeyboardType={CONST.KEYBOARD_TYPE.DECIMAL_PAD}props on the TextInput only affect the mobile virtual keyboard layout — they do not filter characters on web/desktop where a physical keyboard is used.This is in contrast to other numeric inputs in the codebase (e.g.,
validateAmountinMoneyRequestUtils.ts) which validate the raw text against a strict regex like/^\d{1,N}(\.\d{0,N})?$/to reject non-numeric keystrokes.What changes do you think we should make in order to solve the problem?
In
handleStartReadingChangeandhandleEndReadingChangeinIOURequestStepDistanceOdometer.tsx, add a check that rejects the raw input if it contains non-numeric characters (digits and locale decimal separator only). This should be done before the existingisOdometerInputValidcall.The simplest approach: normalize the text first and store the normalized result instead of the raw text. Modify both handlers to run the text through
normalizeOdometerText(or an equivalent filter) before storing it in state viasetStartReading/setEndReading. This way, non-numeric characters are stripped at keystroke time, not just at submit time.Alternatively, add a raw-text regex check (similar to
validateAmount) that returns early if the raw text contains anything other than digits and the locale decimal separator.What alternative solutions did you explore? (Optional)
An alternative would be using an HTML
patternattribute ortype="number"on the underlying<input>element for web. However, this would require platform-specific changes to the TextInput component and is less consistent with the existing codebase pattern where validation is handled in the change handlers.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.51 remaining items
ChavdaSachin commentedon Mar 23, 2026
I think I am due payment here as well, As I already flagged the bug.
And I was reviewer for the prior PR while author for the current, It should be considered as a separate issue.
But since it's a miscellaneous case, I'd happily agree whatever @Julesssss or @neil-marcellini thinks is fair here.
Julesssss commentedon Mar 24, 2026
It's semi related and caused a regression from the prior issue. I think it is fair to have no additional payment, as the original issue bonus wasn't halved. Please correct me if I am mistaken though.
melvin-bot commentedon Mar 30, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
joekaufmanexpensify commentedon Mar 30, 2026
Sounds good. I am going to pay out @ChavdaSachin's existing contract from #83507 since there is no additional payment to them here 👍 cc @mallenexpensify
melvin-bot commentedon Mar 30, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Mar 31, 2026
Good to close?
situchan commentedon Apr 1, 2026
Payment is remaining for me
mallenexpensify commentedon Apr 1, 2026
Payment Summary
Contributor+: @situchan due $250 via NewDot
laurenreidexpensify commentedon Apr 16, 2026
Payment Approved - $250 in New Expensify @situchan