msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
21 stars 13 forks source link

'Line Already Exists' error when entering Prescription #4915

Open marthakeezy opened 3 weeks ago

marthakeezy commented 3 weeks ago

What went wrong? 😲

A little hard to recreate! I've seen it twice, and they occurred when there was an action (e.g. adding a new item to a prescription), and the system was a bit slow to update, causing the screen to freeze, and when I clicked the Save button again to try and save the changes, the error showed up

Screenshot 2024-09-30 at 5 16 04 PM

Hard to run into, so marking as Low Severity

Expected behaviour 🤔

Error should not be there

How to Reproduce 🔨

Steps to reproduce the behaviour:

  1. Go to Dispensary -> Prescriptions
  2. Add a new prescription or edit an existing one
  3. Use dev tools to throttle network speed
  4. Add item
  5. Click OK multiple times in quick succession
  6. See error

Your environment 🌱

lache-melvin commented 3 weeks ago

Given the low likelihood, and low impact, agree severity is low, but we should be using our LoadingButton component on any actions that might take time, so the button is disabled while the prescription is being created 👀 If LoadingButton is being used, we need to check if the correct loading state is being passed in?

andreievg commented 3 weeks ago

Moving priority to normal because of the solution proposed by Lache about loading state