Updated boolean for non-deletion cases in SyncManager determineSyncActions method#38
Open
esmodea wants to merge 3 commits intosilvanocerza:mainfrom
Open
Updated boolean for non-deletion cases in SyncManager determineSyncActions method#38esmodea wants to merge 3 commits intosilvanocerza:mainfrom
esmodea wants to merge 3 commits intosilvanocerza:mainfrom
Conversation
Author
|
Not sure if I'm just running the wrong node version or if the type errors are related to new updates to node packages but I also fixed those, can revert those changes if necessary. |
… when they should have been
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I put together this fix, it has to do with this Issue: #37
here is some context:
Description
When I change any file in the vault it syncs properly but then after it syncs if I don't change that file before next sync it undoes my sync. I've been trying to use this plugin for a small team of devs so we can utilize the Kanban plugin Obsidian has and I can confirm two different machines, one on MacOS and one on Windows 11, have this problem.
Steps to reproduce
Copied Logs
I looked into it and it seems that in the file
src/sync-manager.tsthere's an if-else statement on line 729 that only checks if thelocalSHA !== localFile.sha. I believe it would be more accurate to also checkremoteFile.lastModified < localFile.lastModified, as well as adding an else-if to the latter block to ensure thatlocalSHA == localFile.sha && remoteFile.lastModified > localFile.lastModifiedevaluates to true before downloading the file.Original code
My (somewhat) tested & modified code