event icon indicating copy to clipboard operation
event copied to clipboard

Input Validation: Allowing Alphabetic Characters in Invoice Creation and Payment Fields

Open shubhamkmr04 opened this issue 1 year ago • 3 comments

Describe your enhancement idea

On the send view, users are able to input alphabetic characters when creating an invoice, which should not be allowed. Similarly, when attempting to pay an invoice with alphabetic characters, users receive an error message stating 'amount must be specified when paying a zero amount invoice'.

Steps to Reproduce:

  1. Navigate to the send view.
  2. Type in alphabetic characters in the input field.
  3. Attempt to create the invoice.
  4. Navigate to the payment view.
  5. Input alphabetic characters when trying to pay an invoice.
  6. Observe the error message received.

Expected Behavior:

  1. Users should be restricted from inputting alphabetic characters when creating invoices.
  2. When attempting to pay an invoice with alphabetic characters, users should receive a more informative error message or be prevented from proceeding.

shubhamkmr04 avatar Apr 19 '24 09:04 shubhamkmr04

We can limit the input here to be numeric - it should be a one line fix

kaloudis avatar Apr 19 '24 14:04 kaloudis

It appears the keyboards are set appropriately here, it's only with a full text keyboard (like in dev) that you can get around this - not sure it's worth adding extra logic here

kaloudis avatar Apr 20 '24 03:04 kaloudis

Yeah can't recreate it in my phone, but one issue that might be there is we shouldn't be able to proceed with 0 sats input which results in bad argument error

shubhamkmr04 avatar Apr 20 '24 09:04 shubhamkmr04