rero / rero-ils

Integrated Library System flavour of Invenio by RERO+.
http://ils.test.rero.ch
GNU Affero General Public License v3.0
73 stars 25 forks source link

Multiple loans on same item-patron #3754

Open PascalRepond opened 2 months ago

PascalRepond commented 2 months ago

Bug description:

Sometimes two loans are created on the same item-patron combination. This should never happen as it may cause problems in the circulation and stats. This seems to happen when performing the same circulation operation in very quick succession, e.g. double-clicking on the checkout button. The HTTP request for the checkout is sent to the server twice without giving it time to index the resources, which causes conflicts and errors.

Expected behavior:

It should not be possible to send the same circulation request multiple times in quick succession.

Maybe use Angular to limit the number of request sent to 1 second (?).

Steps to Reproduce:

  1. Go to the pro UI in a patron profile (checkout interface)
  2. Checkout an item: enter the barcode and click on the magnifier multiple times ! To simulate a double scan.
  3. See errors
  4. Check https://ils.test.rero.ch/api/loans/?q=state:CREATED and see that some loans have now the status "created" when they shouldn't.

Context

image