vrtmrz / obsidian-livesync

MIT License
3.93k stars 132 forks source link

Hidden files remain conflicted in sync #383

Open hobbesjaap opened 4 months ago

hobbesjaap commented 4 months ago

Abstract

Conflicted Hidden files refuse to sync/resolve, despite many actions taken.

Expected behaviour

Actually happened

The following files continue to provide errors:

2/16/2024, 10:43:10 AM->Hidden file conflicted:i:.obsidian/plugins/calendar/data.json
2/16/2024, 10:43:10 AM->Hidden file conflicted:i:.obsidian/plugins/folder-notes/data.json
2/16/2024, 10:43:10 AM->Hidden file conflicted:i:.obsidian/plugins/obsidian-day-planner/data.json
2/16/2024, 10:43:10 AM->Hidden file conflicted:i:.obsidian/plugins/obsidian-pandoc-reference-list/data.json
2/16/2024, 10:43:11 AM->Hidden file conflicted:i:.obsidian/plugins/omnisearch/data.json
2/16/2024, 10:43:11 AM->Hidden file conflicted:i:.obsidian/plugins/text-extractor/data.json
2/16/2024, 10:43:11 AM->Hidden file conflicted:i:.obsidian/workspace-mobile.json
2/16/2024, 10:43:11 AM->Hidden file conflicted:i:.obsidian/workspace.json

Reproducing procedure

I have messed things up myself, I fear. I had everything syncing between my desktop, laptop and phone. Some files got into conflict with each other (hidden files).

I've since disabled hidden file sync on my laptop and phone. So it's only running on my desktop. But the files listed above refuse to sync.

I've replaced the remote DB. I've forced sync on all files. I've fetched the remote DB and completely replaced the local DB. But these files continue to give errors.

Some of these don't even exist on my desktop. For example the folder-notes/data.json file or the workspace-mobile.json

Is there a way to just reset these files? When I use the command menu in Obsidian to resolve, it shows the list of files, but selecting a file only creates another "Hidden file conflicted" entry in the log. The error remains.

I'm looking for a way to forcibly remove these files from the sync, reset it and then things should be fine, since I only sync hidden files from my desktop now. Nowhere else.

Any help you can give would be much appreciated - I LOVE your plugin!

Report from the LiveSync

Report from hatch ``` ---- Obsidian info ---- Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/1.5.3 Chrome/114.0.5735.289 Electron/25.9.8 Safari/537.36 ---- remote config ---- cors: credentials: "true" headers: accept, authorization, content-type, origin, referer max_age: "3600" methods: GET,PUT,POST,HEAD,DELETE origins: app://obsidian.md, capacitor://localhost, http://localhost chttpd: bind_address: any enable_cors: "true" max_http_request_size: "4294967296" port: "5984" require_valid_user: "true" admins: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 vendor: name: The Apache Software Foundation feature_flags: partitioned||*: "true" chttpd_auth: authentication_redirect: /_utils/session.html hash_algorithms: sha256, sha require_valid_user: "true" indexers: couch_mrview: "true" prometheus: additional_port: "false" bind_address: 127.0.0.1 port: "17986" httpd: WWW-Authenticate: Basic realm="couchdb" bind_address: 0.0.0.0 port: "5986" smoosh: state_dir: ./data couch_httpd_auth: authentication_db: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 secret: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 authentication_redirect: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchdb_engines: couch: couch_bt_engine couchdb: database_dir: ./data max_document_size: "50000000" single_node: "true" uuid: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 view_index_dir: ./data ---- Plug-in config --- version:0.22.5 couchDB_URI: self-hosted couchDB_USER: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_PASSWORD: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 couchDB_DBNAME: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 liveSync: false syncOnSave: false syncOnStart: false savingDelay: 200 lessInformationInLog: false gcDelay: 0 versionUpFlash: "" minimumChunkSize: 20 longLineThreshold: 250 showVerboseLog: false suspendFileWatching: false trashInsteadDelete: true periodicReplication: false periodicReplicationInterval: 60 syncOnFileOpen: false encrypt: true passphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 usePathObfuscation: false doNotDeleteFolder: false resolveConflictsByNewerFile: false batchSave: false deviceAndVaultName: "" usePluginSettings: false showOwnPlugins: false showStatusOnEditor: false showOnlyIconsOnEditor: true usePluginSync: false autoSweepPlugins: false autoSweepPluginsPeriodic: false notifyPluginOrSettingUpdated: false checkIntegrityOnSave: false batch_size: 50 batches_limit: 40 useHistory: true disableRequestURI: true skipOlderFilesOnSync: true checkConflictOnlyOnOpen: false showMergeDialogOnlyOnActive: false syncInternalFiles: true syncInternalFilesBeforeReplication: false syncInternalFilesIgnorePatterns: \/node_modules\/, \/\.git\/, \/obsidian-livesync\/ syncInternalFilesInterval: 60 additionalSuffixOfDatabaseName: "" ignoreVersionCheck: false lastReadUpdates: 22 deleteMetadataOfDeletedFiles: false syncIgnoreRegEx: "" syncOnlyRegEx: "" customChunkSize: 100 readChunksOnline: true watchInternalFileChanges: true automaticallyDeleteMetadataOfDeletedFiles: 0 disableMarkdownAutoMerge: false writeDocumentsIfConflicted: false useDynamicIterationCount: false syncAfterMerge: false configPassphraseStore: "" encryptedPassphrase: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 encryptedCouchDBConnection: 𝑅𝐸𝐷𝐴𝐢𝑇𝐸𝐷 permitEmptyPassphrase: false useIndexedDBAdapter: true useTimeouts: false writeLogToTheFile: false doNotPaceReplication: false hashCacheMaxCount: 300 hashCacheMaxAmount: 50 concurrencyOfReadChunksOnline: 100 minimumIntervalOfReadChunksOnline: 333 hashAlg: xxhash64 suspendParseReplicationResult: false doNotSuspendOnFetching: false useIgnoreFiles: false ignoreFiles: .gitignore syncOnEditorSave: false pluginSyncExtendedSetting: {} syncMaxSizeInMB: 50 settingSyncFile: "" writeCredentialsForSettingSync: false notifyAllSettingSyncFile: false ```
vrtmrz commented 4 months ago

Thank you for opening the issue! The simplest way is Rebuild everything.

Self-hosted LiveSync respects and preserves the conflict as is, if it is not resolved. And, it will be synchronised between the remote and every local as is. This behaviour makes us able to resolve the conflict on any device.

Therefore, if we cannot resolve the conflicts for any reason, we should rebuild both the local database and remote database at once. This is the Rebuild everything.

However, this was probably a result of some bugs. Hidden file handling is now fixed at v0.22.7. Would you mind if I ask you to check the v0.22.7, please? May our (My, and of course, your) plugin answer you all love. I am so proud of the honour.

vrtmrz commented 4 months ago

Hi! New information! If the problems still exist, v0.22.10 may help further.