/
Transform editing window tracking [5.2.2-B2]
Transform editing window tracking [5.2.2-B2]
In-Portal has an editing window tracking system to prevent multiple users from editing the same record in parallel. It works like this:
- upon "Edit" button press in the grid:
- temporary table(-s) are created (table name contains "session id" and "window id") to hold edited record data
- check is made, that no similar temporary table (created by this or another user) exists already (means nobody is editing the same thing as I'm editing)
- if enabled by the developer, then the user is presented with an alert dialog showing who is editing the same data currently
- upon the "Cancel" button press in the editing window:
- the temporary tables are deleted
- upon the "Save" button press in the editing window:
- data is copied from the temporary table back to the live table
- the temporary tables are deleted
- upon direct window closing (the "X" icon pressing):
- the temporary tables created for that window are deleted
The current system has several drawbacks:
- when, for some reason, a web browser fails to properly report window closing fact, then temporary table stay and particular database record appear as being edited, while in reality, they're not
- all database tables need to be introspected to understand what records are being edited
Solution
Introduce real-time editing window tracking system (replaces current one), that works like this:
- each editing window is being registered in the memory table (session id, window id, user, item prefix, item id)
- each editing window periodically (configurable) reports back to inform, that it's still being opened
- upon window closing, (save button, cancel button, "X" icon) information about the editing window is immediately removed along with associated temporary tables
- a scheduled task periodically (configurable) looks for registered windows that failed (e.g. non-detected closed editing window) to report back and purges them (window record, temporary tables)