]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1777698 Duplicate barcode alert appearing on new barcodes
authorDan Briem <dbriem@wlsmail.org>
Sun, 11 Aug 2019 01:02:00 +0000 (21:02 -0400)
committerMike Rylander <mrylander@gmail.com>
Mon, 21 Oct 2019 13:41:19 +0000 (09:41 -0400)
commit75dbebe20fcd4faea04815a34ee6d2d5b5c2bbb7
tree2c9f3260e40a371c9d6a76ed3d29d30ea7486092
parent4f3712cdfa602d0a7522c23e5f9d5e0fc07a9dae
LP#1777698 Duplicate barcode alert appearing on new barcodes

When scanning new copy barcodes, ng-change quickly fires multiple times
and sends promises to check for duplicates. If 1234 exists and you scan
12345, if the 1234 promise resolves after 12345, it will indicate it's a
duplicate. This patch keeps a count of the promises sent and only the
latest promise will set the boolean to indicate if it's a duplicate.

Hard to test because the promises usually resolve in order:
1. Add a new holding with the first few characters of an unused barcode
2. Scan the new barcode multiple times until you see the dup error
3. Apply patch and scan the new barcode multiple times (no error)

Signed-off-by: Dan Briem <dbriem@wlsmail.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js