App: [HOLD for payment 2022-05-20][$1000] - Audit forms and fix inconsistencies with modifying user input

We should audit all our forms and fix any inconsistencies with modifying user input. The expected behavior is as follows:

  1. User input should not be modified as they type.
  2. User input that may include optional characters (e.g. (, ), - in a phone number) and should never be restricted on input, nor be modified or formatted on blur.
  3. Instead we will format and clean the user input internally before using the value (e.g. making an API request where the user will never see this transformation happen)
  4. Additionally, users should always be able to copy/paste whatever characters they want into fields.

To give a slightly more detailed example of how this would work with phone numbers we should:

  • Allow any character to be entered in the field.
  • On blur, strip all non-number characters (with the exception of + if the API accepts it) and validate the result against the E.164 regex pattern we use for a valid phone. Stripping characters should happen internally and result in NO UI change to the user.
  • On submit, repeat validation and submit with the clean value.

Here’s a list of forms to be audited:

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 75 (54 by maintainers)

Most upvoted comments

@puneetlath please note that we should add one milestone per 5 forms (4 milestones total).

Hmm that seems to be out of scope for this issue.

Shouldn’t this be convered as part of this issue?

@JmillsExpensify Yes! This was the last payment so I believe that all milestones have been paid out. Thanks for working on this!

A couple more days left on the 7-day hold for that last PR.

@JmillsExpensify as per this comment, there should be 4x $250 milestones for this job, for a total of $1000. As of now, 3/4 milestones have been completed ($750).

@eVoloshchak when do you think you can complete the last 4 audits?

@JmillsExpensify For this issue, there are 4 milestones on Upwork. Each milestone requires an audit of 5 pages.

And @eVoloshchak has audited 16 pages. So it’s fair to pay for 3 milestones ($750). Let me know if this clarifies it. Thanks!

The remaining could be settled after the latest PR https://github.com/Expensify/App/pull/8764 is on production for 7 days

Looks like this is still being discussed in Slack.

Thanks for the quick feedback!

Can I start working on this

Not yet 😃 We need some consensus first. Edit: slack 🧵 here https://expensify.slack.com/archives/C01GTK53T8Q/p1649702197809359

Alright, I’m aware that max length isn’t our concern as per the issue description.

But having a max length doesn’t allow a user to paste anything they want.

Yeah, I too was thinking about max length interfering with users should always be able to copy/paste whatever characters they want into fields requirement, but figured I should leave the max length as it is.

I’ll remove max length, if that’s the requirement, no problem 😃

I’ll prepare a list of errors I need English and Spanish translations for (something like “SSN/Zip/CVV can’t be longer than x digits”) Can I start working on this or is it up for discussion on Slack?

Since @eVoloshchak is facing internet issues, I’m gonna post videos to confirm the audit. (ETA: Monday)

I’ve updated my original comment with videos for each audited form

Since @eVoloshchak is facing internet issues, I’m gonna post videos to confirm the audit. (ETA: Monday)

Thank you

Do we need to release this back into the general pool for more submissions? It has been more than a month. (cc @eVoloshchak)

Sorry for the huge delay. I’m planning to submit first PR in two days, if I don’t do that, please release it to the pool (I’ll try to leave a message if I can’t finish the job, but there’s huge problems with internet access, so I might not be able to, so consider absence of the pr in two days as this message). Again, sorry for the delay, I’ll try to make sure this never happens again

I’m going to switch this to weekly while we await @eVoloshchak’s pull request.

@eVoloshchak that’s understandable, please take care. Please take your time, looking forward for your PR 😃

@eVoloshchak how is this going?

Started working on it, will submit first PR on Monday. It’s taking me more time than expected due to an extreme situation in Ukraine, sorry for that

@eVoloshchak feel free to create multiple PRs for this, in case there are a lot of changes.

Got it. I was planning to submit them in groups of 4-5.

@eVoloshchak I’ve gone ahead and assigned you the issue. Can you please apply to the Upwork job so that I can hire you there as well?

Submitted a proposal on Upwork

🎀👀🎀 C+ reviewed

@puneetlath I think we’re good to assign @eVoloshchak this issue 😄