UniversityRadioYork / MyRadio

University Radio York's back-end radio management system
https://ury.org.uk/myradio
16 stars 16 forks source link

[WIP] Check for concurrent edits of showplans #1191

Open markspolakovs opened 1 month ago

markspolakovs commented 1 month ago

Add a simple mechanism to check if two people are editing a showplan at the same time, by storing the time it was last modified.

Will go together with a WebStudio change that will, when opened, get the last modified time from the server, and then send it back on every updateShowPlan call. The server will only accept the change if the time still matches (guarded by a SELECT FOR UPDATE), otherwise WebStudio will force the user to reload.

This can be a bit annoying, but the alternative is showplan corruption. Perhaps we can make WebStudio periodically poll for new changes to make it less annoying.