[MGNLSLOCK-32] Port soft locking module to 5.0 Created: 22/Aug/14  Updated: 23/Jun/15  Resolved: 27/May/15

Status: Closed
Project: Magnolia Soft Locking Module
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5

Type: Task Priority: Major
Reporter: Federico Grilli Assignee: Espen Jervidalo
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLUI-2963 Update AdminCentral to use latest Vaadin Closed
depends upon PAGES-3 Provide stop method in Extension Closed
depends upon MAGNOLIA-6203 Inject the Context to ContextLocalePr... Closed
depends upon PAGES-20 Extensions: pass location to start() ... Closed
is depended upon by MGNLSLOCK-27 As an editor, I can use the soft lock... Closed
relation
is related to MGNLSLOCK-34 Do not show extension on public instance Closed
is related to MGNLSLOCK-35 Notify user about moved and deleted page Closed
is related to MGNLSLOCK-37 UI glitches in SoftLocking for M5 Closed
is related to MGNLSLOCK-36 Add polling to get "real-time" update... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Comments   
Comment by Federico Grilli [ 02/Sep/14 ]

Current implementation uses the Refresher add-on but should be revised and use instead Vaadin's built-in polling mechanism. In particular, since Vaadin 7.2 http://dev.vaadin.com/ticket/12466 a PollListener has been added to the UI class. This make the Refresher add-on completely replaceable by Vaadin's built-in polling mechanism.

Comment by Espen Jervidalo [ 12/Mar/15 ]

As discussed: I would like to give this another try.

Comment by Espen Jervidalo [ 11/May/15 ]

As we're using observation to notify the users about changes, which is running in a thread without MgnlContext set, we had to make sure that SimpleTranslator has the context set during instantiation of the SoftLockingExtension. See linked ticket MAGNOLIA-6203.

Comment by Espen Jervidalo [ 11/May/15 ]

Step-by-step commits on MGNSLOCK-32, squashed on MGNLSLOCK-32_ej

Comment by Philip Mundt [ 12/May/15 ]

Two very small things:

  • info.magnolia.module.softlocking.DefaultSoftLockingSupport#onEvent should use a while to iterate over all events
  • public modifier of info.magnolia.module.softlocking.SoftLockingSupport.LockListener is unnecessary
Comment by Federico Grilli [ 26/May/15 ]

Tested on https://jenkins.magnolia-cms.com/view/Team_jobs/job/ee_bundle-team_cms-branch/183/

  • Opened two different browser sessions with two different users, superuser and eric (editor)
action expected result actual result
superuser starts editing travel page no notification, status bar shows 0 concurrent users OK
eric starts editing travel page eric sees notif "there are other users editing this page", superuser sees notif. "eric starts editing this page", status bar shows 1 concurrent user. Clicking on it shows the name of the other editor no notifs or user update count in status bar, unless one clicks on the status bar itself (possibly other UI elements too)
eric modifies travel page superuser sees notif. "eric has just saved this page", status bar shows a warning icon signalling that the page was modifed. Clicking on it shows the message "new edits are available". Warning icon disappears no notifs or warning icon in status bar, unless one clicks on the status bar itself (possibly other UI elements too)
eric previews travel page and goes back to edit status bar of both users shows same number
eric leaves travel page (closes tab, navigates to another page, etc.) superuser sees notif. "eric is no longer editing this page", status bar shows 0 concurrent users no notifs or user update count in status bar, unless one clicks on the status bar itself (possibly other UI elements too)
eric renames (or moves/deletes) travel page superuser sees warn notif. "An error occurred while trying to get the status of this page from the server. ..." not tested yet
on a public instance no soft-locking icon is displayed in the page bar not tested yet
soft-locking is disabled no soft-locking icon is displayed in the page bar (might require, closing and reopening page editor tab) not tested yet
Comment by Espen Jervidalo [ 26/May/15 ]

There is no polling implemented. If you have two editors working simultaneously on a page, you won't realize the difference.. every click will trigger a repaint. I consider it less important as for e.g. pulse messages. Anyway if we want polling to be implemented, we should have a central mechanism for registering polling. Here's a use case showing the problem:

  • you register one poll interval in soft-locking
  • open a dialog with upload-field, which will override the poll interval,
  • close the dialog after uploading
    -> and it will reset it to -1 and the polling is gone in the page editor

Besides that:

  • I have pending changes, for the deletion and move of the page. Will create a follow-up ticket.
  • public instance won't work. -> follow up ticket
  • soft-locking disabled. Why? Just remove the module?
Comment by Federico Grilli [ 27/May/15 ]

Had a quick chat with Espen which helped clarify some points. It actually would be possible to re-introduce polling with a simple one-liner in the start() method, something like UI.getCurrent().setPollInterval(5000). The good thing about the new implementation is that, being event-based, it puts much less load on the server and in our case - with polling enabled - would trigger a UI repaint only in case of an actual update, thus performance issues should be greatly mitigated. However, as Espen explains above, being polling a UI session-wide mechanism, there might be cases where another component uses it (e.g. progress bar in file upload) thus causing polling for page changes to stop working (which might be solved with a central registry for polling) .
At any rate, it all boils down to

  • my view: re-enable polling, cause without it SL usability and UX would be bad
  • Espen's view: polling is disabled cause it may be problematic in some use cases, besides putting more load on the server
Generated at Mon Feb 12 07:14:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.