Duplicated stock events when submitting adjustments

Description

Currently, there is a possibility to submit and confirm the same adjustment more than once. It may happen when the user goes back to the previous screen (when the loading modal is displayed) after confirming the adjustment. It causes the stock event to be sent again.

Example reproduction steps:

  1. Change the Network to Slow 3G and CPU to 6x slowdown;

  2. Log into the application as administrator;

  3. Go to Stock Management > Adjustments.

  4. Start making adjustments for Essential Meds.

  5. Add an adjustment and confirm it.

  6. Refresh the page a moment after the POST stockEvents request becomes visible in "Network".

  7. Add the same product for which the adjustment was being made to the table on the "Adjustments" screen.

  8. The product's "Stock on Hand" is already updated, even though there was no notification.

Acceptance Criteria:

  • make sure that submitting the same adjustment multiple times is impossible

  • the solution should not affect the performance

Environment

None

Assignee

Paulina Buzderewicz

Reporter

Klaudia Pałkowska

Labels

None

Components

Sprint

None

Fix versions

Affects versions

Priority

Critical
Configure