Angular catalog: using replace barcode on multiple items actually just does the same item over and over again

Bug #1837067 reported by Jane Sandberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Medium
Unassigned

Bug Description

There is a small race condition in the replace barcode code. As a result, you can recreate the following error:

1) In the experimental Angular staff catalog, open up a bib record.
2) Open the Holdings View tab.
3) Select several items.
4) Use the Actions for Selected Rows menu to Replace Barcodes.
5) Change the first barcode to something recognizable. Click the Replace Barcode button.
6) Note that the dialog opens again to ask you to replace the barcode you just added.

Branch forthcoming.

Revision history for this message
Jane Sandberg (sandbej) wrote :

Branch here: user/sandbergja/lp1837067_race_condition_in_replace_barcode
Here's a link: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sandbergja/lp1837067_race_condition_in_replace_barcode

Testing instructions and other details from the commit message:

    To test:
    1) In the experimental Angular staff catalog, open up a bib record.
    2) Open the Holdings View tab.
    3) Select several items.
    4) Use the Actions for Selected Rows menu to Replace Barcodes
    5) Change the first barcode to something recognizable. Click the
    Replace Barcode button.
    6) Note that the dialog opens again to ask you to replace the
    barcode you just added.
    7) Apply this patch.
    8) Repeat steps 1-5.
    9) Note that the dialog opens again to ask you to replace the next
    barcode.

    Also removes some unused imports, and consolidates two RxJS pipes that were next to one another.

tags: added: pullrequest
Changed in evergreen:
assignee: Jane Sandberg (sandbej) → nobody
Bill Erickson (berick)
Changed in evergreen:
status: New → Confirmed
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Thanks Jane. Issue confirmed. I've pushed another branch which merges your changes, but tweaks the solution to the main issue.

I have no strong preference for using await/async, but I didn't want to leave the impression that was the source of the bug. The problem was the unwatched Observable returned by getNextCopy() (pcrud.retrieve() under the covers). Since nothing subscribed, piped, etc. the Observable never fired and the next copy was never fetched from the network.

Of course, if removing the await/async (e.g. as a preference) was intentional, that's fine, I'll sign off on your original commit.

Commit also removes an unnecessary throwError() and its import.

To reduce churn, I squashed my changes into your commit.

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1837067-replace-bc-race

Changed in evergreen:
milestone: none → 3.3.3
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Jane Sandberg (sandbej) wrote :

Thanks, Bill. I'm still getting used to await/async. I like your version better, especially since it keeps the replaceOneBarcode method consistent in using await/async, instead of a mix of different promise syntax.

I've tweaked the commit message a bit to match the actual problem, and pushed your version to master and rel_3_3.

Changed in evergreen:
importance: Undecided → Medium
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers