djplaner / canvas-collections

Transform Canvas LMS modules by adding structure, visuals, and context
https://djplaner.github.io/canvas-collections/
GNU General Public License v3.0
1 stars 0 forks source link

Add a check for a stale edit lock on start up #272

Closed djplaner closed 1 year ago

djplaner commented 1 year ago

For various reasons there may be a stale edit lock hanging around.

Current design

djplaner commented 1 year ago

Design exploration

Initial thought is to do this in the editOnController as part of turning the edit lock on.

Most of it is there at the moment. The challenge is the long chain of disconnected functions. In particular, the chain associated with turnEditOff. Most of this is working, having deleted the file. But we get to finalCheckForEditOnOff and it's coded to call finishCallBack - when it should not do that

Should it

Mabye have to set a private member to distinguish.

Documenting

Turn edit on

Current plan

IF we simply set editon status to NO_ONE_EDITING the normal turn edit on process will

djplaner commented 1 year ago

Checking self for stale edit lock

When I am the user with a stale edit lock. Need to detect and tell me about it and modify the interface ASAP.

WHen should/could it be done?

What might it look like

What should it do

Exploring how

djplaner commented 1 year ago

Requirements

Has the stale lock

Found the stale lock of another

djplaner commented 1 year ago

Detecting stale lock for "has stale lock"

Only delete lock file if you own

turnEditOff

Implemented this

djplaner commented 1 year ago

Mapping process again - editingOnController

turnEditOn

createEditingOnPage -> async postData

finalCheckForeditOnOff

turnEditOff

checkDeletion

djplaner commented 1 year ago

Mapping what happens with stale

The pure turn on and off is working fine. It is the way in which stale lock is detected (by the different actors) and what happens where the problem occurs

updateEditingDetails is calling staleEditLock

This check for staleEditLock is causing some disruption. -- this check should be done outside???

Looking to move the stale lock check out of updateEditingDetails

Question is where does this check need to be done

EditingOnController seems to be working CanvasCollections is next

The nuts and bolts of turnEditOn/Off is happening, but the higher level - esp. for holder of stale lock - is not happening.

djplaner commented 1 year ago

Test cases

saving to the configuration file

Where is the saving done

startSaveCollections - calls isStaleEditLock

It is working here - not being able to save and getting repeated errors - but that's because we're not correctly remove it

Updating the user interface

Working - but the turningEditOff is removing the edit lock when it is owned by someone else...not what we want here