Bug 51165 - Harden computerroom module frontend against side effects and provide better error message
Harden computerroom module frontend against side effects and provide better e...
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Computer room
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v5-errata
Assigned To: Ole Schwiegert
Tobias Wenzel
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-24 11:20 CEST by Ole Schwiegert
Modified: 2020-07-30 15:13 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.023
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ole Schwiegert univentionstaff 2020-04-24 11:20:27 CEST
A customer managed to produce a situation where the computer room was not in exam mode anymore, but a finish_exam was triggered in the frontend producing an error since the frontend module had no information about any running exams anymore it could stop.

We could reproduce this error neither in our testing environment nor on their systems, so we decided to improve the frontend by providing a more meaningful error message and check with the server again in case of error if there is an exam running or not.
Comment 1 Ole Schwiegert univentionstaff 2020-04-24 12:48:24 CEST
Changes implemented in oschwieg/4.4/51165

Whenever the finish_exam function is triggered the UMC call to update the room info is triggered manually to make sure that the newest information of the room are available. If now there is no exam information present in the room, a message is shown to the user that the exam was apparently finished from somewhere else.

It might be a good idea to have another look at the synchronization between the exam project file and the room file to see if there are situation where the information can be de-synced.

How to reproduce the error message from the customer:
- Start an exam and enter the computer room
- Click on "Finish exam", but do not confirm the upcoming dialog yet.
- On the server edit the file /var/cache/ucs-school-umc-computerroom/${ROOM_NAME} and remove the exam entries (exam=, examEndTime=, examDescription=)
- Wait for the computer room in the UMC to update. You should see the exam mode specific elements in the computer room disappear.
- Confirm the dialog to finish the exam
- You will get a ValidationError, saying that exam is a required field (Before fixes).
- You will get a message that the exam was apparently finished from somewhere else (after fixes).

This fixes in no way the underlying problem of the customer loosing the exam information from the frontend in between finishing the exam, but this is about all we can achieve in the frontend alone.

After the newest updates for UCS and UCS@school are installed on the customer machines, we want to try triggering this problem again.

Please REOPEN for merge&build
Comment 2 Tobias Wenzel univentionstaff 2020-04-24 14:03:19 CEST
QA -> all ok => please merge and build


[oschwieg/4.4/51165] 551fea258 Bug #51165: Check room status before finishing exam and provide better error message in frontend


Code -> looks good
Functionality -> works as expected

 before fix, a ValidationError is thrown
 after fix, I got the msg "There is no exam running in this room anymore. It seems like the exam was finished properly from somewhere else." (also in german).
Comment 3 Ole Schwiegert univentionstaff 2020-04-24 14:51:59 CEST
Package: ucs-school-umc-computerroom
Version: 11.0.0-19A~4.4.0.202004241449
Branch: ucs_4.4-0
Scope: ucs-school-4.4

Package build
Comment 4 Tobias Wenzel univentionstaff 2020-04-24 14:58:53 CEST
yaml -> ok
changelog -> ok

[4.4] 989e14545 Bug #51165: Fill advisory
[4.4] 137f0c7e9 Bug #51165: Add advisory
[4.4] a84a52aa8 Bug #51165: Add changelog
[4.4] d632cf6c1 Bug #51165: Check room status before finishing exam and provide better error message in frontend
Comment 5 Tobias Wenzel univentionstaff 2020-07-30 15:13:58 CEST
UCS@school 4.5 v5 has been released (errata update to the release).

http://docs.software-univention.de/changelog-ucsschool-4.4v5-de.html#changelog:ucsschool:2020-04-27

If this error occurs again, please clone this bug.