1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-06 09:19:22 +02:00

Doc: Added more info about sync lock refresh mechanism

This commit is contained in:
Laurent Cozic
2020-09-11 11:26:07 +01:00
parent 5f410e80e6
commit cf78204c85
2 changed files with 10 additions and 0 deletions

View File

@@ -292,6 +292,12 @@ export default class LockHandler {
if (!this.refreshTimers_[handle]) return defer(); // Timeout has been cleared
if (!hasActiveLock) {
// If the previous lock has expired, we shouldn't try to acquire a new one. This is because other clients might have performed
// in the meantime operations that invalidates the current operation. For example, another client might have upgraded the
// sync target in the meantime, so any active operation should be cancelled here. Or if the current client was upgraded
// the sync target, another client might have synced since then, making any cached data invalid.
// In some cases it should be safe to re-acquire a lock but adding support for this would make the algorithm more complex
// without much benefits.
error = new JoplinError('Lock has expired', 'lockExpired');
} else {
try {