Closed kadisonm closed 10 months ago
Really appreciate the PR!
I think that section needs a refactor so that the queue can upload at a concurrency of 1 (if that is possible).
I agree, do you think you could take a stab at making that change? If you don't have the cycles to do that happy to take that on at some point, too, we can merge as is. Just feels like a good opportunity.
Yep I can do that. I had a try at refactoring it before letting you know and I think I have fixed a lot of issues. I believe the for loops were finishing before some promises were resolved, which was causing the metadata to sync before it had finished syncing. Switched it all to for of loops to make sure everything is done before continuing. I'll commit soon.
I updated the pull request description to list the fixes I think it fixes. I need to run a couple tests first to confirm.
Edit: Can confirm it fixes the status bar issues and syncing a large vault is really satisfying to watch now.
For the most part it fixes the status bar jittering. But I did notice it change once to something else then quickly back to the queue numbers.
Wow, that's great news! Glad to hear. I'll merge and do my own testing & ship this release. I'll keep the issues open add comments to the issues and take the time to do more testing (have some test vaults attached to those issues that used to have issues, worth double checking they are gone).
Did the status bar issues go away with concurrency > 1? Or for concurrency == 1?
Thank you again for the PR, greatly appreciated!
Fixes #98 and stop syncs running more than once. syncRun only had a check to stop manual syncing if the sync is already running but ignored it for the other sync trigger types. Let me know if this was intended behaviour or not.
Fixes Sync on Remote not running on file modification. This is because the metadata would only upload/change if there was deletions. Removed the check for this so that metadata is uploaded on every sync regardless if it is the same.
Fixes metadata not uploading if the concurrency is 1 and refactors the doActualSync code.
Fixes #68 and mostly fixes #46. There are still occassions where the status bar flashes to something else, #102.
Fixes bug found in #98 where metadata could sync before sync completes. Additionally, it fixes all logged statements being out of order. Syncing concurrently will appear out of order because they finish at different times, but all the start syncing will be in order.
Fixing metadata not uploading if the concurrency is 1 added an if statement to the already many nested for loops. I think that section needs a refactor so that the queue can upload at a concurrency of 1 (if that is possible). So that we can just delete the whole check for concurrency being 1.