[UICR-177] Courses App: Instructor is not removed from a course listing when deleted. Created: 20/Dec/22 Updated: 29/Aug/23 Resolved: 28/Feb/23 |
|
| Status: | Closed |
| Project: | ui-courses |
| Components: | None |
| Affects versions: | None |
| Fix versions: | 6.0.0 |
| Type: | Bug | Priority: | P2 |
| Reporter: | Sarah Johnson | Assignee: | Mike Taylor |
| Resolution: | Done | Votes: | 0 |
| Labels: | support | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Attachments: |
|
| Sprint: | Thor - Sprint 159, Thor - Sprint 157, Thor - Sprint 158 |
| Development Team: | Thor |
| Release: | Orchid (R1 2023) Bug Fix |
| Affected Institution: |
!!!ALL!!!
|
| RCA Group: | TBD |
| Affected releases: |
Nolana (R3 2022), Morning Glory (R2 2022)
|
| Description |
|
Overview: When ** deleting an instructor from a course record, the instructor is not automatically removed from the course upon clicking the trashcan icon. Instead, the screen needs to be refreshed in order for the deletion to be visible. **
Expected Results: The instructor will be removed from the course. On MG Bugfest, you can see that the API call /instructors/ {instructorId}returns a 204 response. The page does not refresh. I'm able to replicate both correct and incorrect behavior on the Snapshot environments. I'm not able to replicate correct behavior on the Snapshot environments with a course that I created, but I am able to replicate it with the one course with instructor assignments that is loaded from the reference data. Here's an example screencast from Snapshot-2 showing the behavior as expected: snapshot-2-worksasexpected.mp4 On Snapshot 1, here is an example screencast with a course I created showing the behavior not working as expected: snapshot-1-doesnotworkasexpected.mp4 Both screencasts were captured on 1-30-2023. URL: |
| Comments |
| Comment by Ann-Marie Breaux (Inactive) [ 03/Jan/23 ] |
|
Hi Charlotte Whitt There's no dev team assigned to this bug. Should it be Thor? Please update as needed. Thank you! |
| Comment by Erin Nettifee [ 04/Jan/23 ] |
|
This bug is not present on Snapshot, but it is present on Bugfest-nolana as well as Bugfest-morning glory. Hmmm. |
| Comment by Erin Nettifee [ 04/Jan/23 ] |
|
Actually, I was able to replicate this on Snapshot with a new course, but not with a course loaded as part of reference data... |
| Comment by Mike Taylor [ 27/Feb/23 ] |
|
Having investigated this a bit, I think the rule is that if there is only one instructor, and no others have been added and deleted, then deleting that instructor does not correctly refresh display. By contrast, if when you enter the course page there are two or more instructors; or if you add one or more instructors before deleting, then the page refreshes as intended when the last one is deleted. This is on https://bugfest-mg.int.aws.folio.org/ |
| Comment by Mike Taylor [ 27/Feb/23 ] |
|
I now have some handle on what's going wrong here. When an instructor is deleted, we force a redraw of the page for forcing a re-fetch of the course object (which contains the courseListing object which contains the instructor list). The way we do this is by decrementing the value of a stripes-connect local resource called instructorCount, and then using the as the value of an ignored parameter in the WSAPI call to fetch the course. For reasons that I do not yet understand, the initial value of this parameter on entering the page where you can delete instructors is sometimes set to zero. That means that when we reduce the count to the new number of instructors, it gets set to zero, which means it doesn't change, which means the page doesn't redraw. The real question here is how the initial value gets set to zero. |
| Comment by Mike Taylor [ 27/Feb/23 ] |
|
And the answer is that there is nothing special about the value 0: that's just what it gets decremented to when you delete the last instructor in a course, and it never get incremented again. You can provoke the same bug as follows: add two instructors to course A, then add two instructors to course B. Delete one of the two instructors, and the instructorCount resource gets set to the number of remaining instructors, i.e. 1. Then go to course A and delete one of the two instructors that it has, and again instructorCount gets set to the correct new count of 1 — which means it hasn't changed, and the page doesn't refresh. There are a number of ways this could be fixed. |
| Comment by Mike Taylor [ 28/Feb/23 ] |
|
I changed the meaning of the cache-defeating unused WSAPI parameter, so that instead of trying and failing to track how many instructors there currently are in the course, it just tracks the total number of deletions that have been performed in session. This works reliably. |