-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for old local storage entries #6813
base: v5/develop
Are you sure you want to change the base?
Conversation
@bastianallgeier What happens if there are multiple users with local storage changes? Or if one user already has made edits in the new content but an outdated legacy local storage form another user appears? |
I've converted the PR to a draft for now while we still need to discuss the details. The current state assumes that locking is handled properly on the backend and that those changes could not be saved if someone else locked the content in the meantime. To support the old .lock files would be a second part of the puzzle. But to compare it with the old v4 setup, the effects should be very similar. If two editors get into a race and both make changes on their ends, the first one to store the changes wins. The second scenario that you describe cannot happen as far as I know. Since localStorage is bound to the browser, there cannot be any unexpected changes from other users. |
I think we need to plan both together to make sure it really works at the end: v4 locks have been indefinite while v5 locks are just temporary. How do we ensure the v4 behavior when we migrate the .locks to v5 locking? Previously,our system should have prevented that two different users both create a localStorage (due to locking). But with the migration, it's easily to imagine one user starting a v5 changes version and another user coming around a day later with an old v4 localStorage. In v4 we offered to download the localStorage if any newer changes were made by another users (e.g. via unlock). I think our migration would also need to consider if the localStorage changes are still the most recent changes and not newer changes already have been applied to the content and would be overwritten by old stuff. |
Idea:
|
I like the idea. And when the localStorage data is sent, we could then trigger the removal of the .lock file. Worst case with that: a page is constantly blocked because that one colleague who started the lock never signs in. |
We could either use the same timeout that we currently use for the new locks or we could have a second longer one for those older changes. |
But then we would have the danger again that this colleague returns after two weeks and their changes are automatically sent (as lock has expired) and overwrite all the work their colleagues made in the meantime. So I am thinking that the |
We could always check whether there are changes or a latest version with a later modification timestamp. In both cases, the old content from local storage would not be applied. |
So to summarize (can be handled in additional PR, if preferred):
|
@distantnative I'm continuing more of the backend stuff over here: #6816 |
e233cd4
to
7a73938
Compare
@bastianallgeier Supported multi languages? Works with single language but I couldn't achieve for multi languages env. |
@afbora it really should. If it's not working, I have to check again. |
@bastianallgeier It doesn't work or I can't tested correctly 🙈 I think we should make sure that. |
3b8ddef
to
5f93ee3
Compare
Description
The ModelView checks for old content changes in local storage and sends those to the changes API when the view is being loaded.
Summary of changes
panel.content.legacy
module with methods to check for legacy changes, to import them and clean up local storage afterwards.isActive
is now being added to thelock
object. This makes it possible to check if the lock already expired, which we need in order to decide if the changes in local storage should still be imported.How to test?
This is pretty tricky, because a couple things have to be true for this to work. Here's the best way that I found so far:
You should now see the Test subheading and active changes. The following should be true:
Ready?
For review team