Code Monkey home page Code Monkey logo

Comments (3)

dlphnkck avatar dlphnkck commented on July 17, 2024

docs/settings.md→Hatch

Hatch

From here, everything is under the hood. Please handle it with care.

When there are problems with synchronization, the warning message is shown Under this section header.

  • Pattern 1
    CorruptedData
    This message is shown when the remote database is locked and your device is not marked as "resolved".
    Almost it is happened by enabling End-to-End encryption or History has been dropped.
    If you enabled End-to-End encryption, you can unlock the remote database by "Apply and receive" automatically. Or "Drop and receive" when you dropped. If you want to unlock manually, click "mark this device as resolved".

  • Pattern 2
    Image from Gyazo
    The remote database indicates that has been unlocked Pattern 1.
    When you mark all devices as resolved, you can unlock the database.
    But, there's no problem even if you leave it as it is.

If the above explanation in settings.md is not clear enough , please refer to the Code, TypeScript, markRemoteLocked(), markRemoteUnlocked(), and markRemoteResolved() sections.

This will help you understand the code of the LiveSync plugin.

from obsidian-livesync.

CupricReki avatar CupricReki commented on July 17, 2024

I think the confusion comes from the Lock remote database button is on the Maintain database page, but the unlock database is done from the Hatch page.

Maybe grey out the Lock button when the database is already locked and indicate somehow that the database can be unlocked elsewhere. Better yet, just combine Hatch and Maintain database pages. Them being separate is confusing.

from obsidian-livesync.

vrtmrz avatar vrtmrz commented on July 17, 2024

Sorry for being late! As you mentioned, we do not have to unlock the database.

The purpose of Lock is to prevent the connection of another non-empty device, and to avoid unexpected conflicts of files.
The device whose connection is prevented will be needed to mark itself as resolved on the remote. (Actually, the device which has no resolved mark disconnects itself).

One of the ways of marking resolved is @dlphnkick mentioned at first. However, as a note, it is a very manual feature and not recommended for casual usage.
Instead of that, while replicating to the rebuilt remote database (Locked and
the device not resolved), we can decide to unlock the remote by fetching the remote again.
When fetching, the remote is marked resolved by the fetching device. When rebuilding a remote database, it is always locked and marked resolved only by the rebuilding device.

Therefore, once the remote database has been locked, it usually should not be unlocked before all your synchronised devices have been resolved. And, owning each device would not know about the past connected other devices, it could not be unlocked automatically instead of resolving.

In summary, Locking the database is a usual operation to prevent corruption. But resolving should be automatically performed and the manual operation should be under the bonnet. (And, fetching, overwriting, rebuild all is on the Maintain database).

I hope this provides you with the insight you were seeking!

from obsidian-livesync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.