-
-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use native filesystem events on Mac #472
Comments
Same behavior with version 1.5.10 (1631) of TextMate. SparkleShare does not notice the file has changed after saving. |
Do you know if SparkleShare detects a change in the file? |
Opening, editing and saving the file with TextMate does not cause any log entries in Console. After editing and saving with TextMate it suffices to open the file with Vim (not even editing or saving) for SparkleShare to detect the changes and perform a sync. So in short: |
I've reproduced it but I don't see how to fix this. SparkleShare just listens to events from the OS. I think this has to do with how TextMate saves files. Maybe file an issue there? |
I agree it probably is because of the way TextMate saves files. I still think this is real issue for a file syncing app such as SparkleShare. Apparently there are ways to alter files such that the filesystem events, that SparkleShare captures, are not triggered. I'll try to look into it myself too, maybe I can find useful information. Update: Update2: |
If I've read the source correctly, every minute the whole file tree is searched for changes, and in a shorter interval, it is checked if the Mono file system listener has triggered, but at least it does never in my case. To solve this problem (at least it is one for me :) ), I modified the source, to use FSEvents in Mono, as done here: It needs further testing, but it seems to work well. If someone is interested, I could post my modifications. |
@kernch yes please! |
I uploaded it here: It's a replacement for SparkleMacWatcher.cs. It uses the MonoMac Libs. Right now, it's a very dumb hack. If a change is detected, all git repositories are updated. It can be made more precise, because FSEvents report the directory path in which the change happened, but I did not have the time to find out how exactly this is managed in SparkleShare. |
@kernch Thanks. I'll test this soon and hopefully integrate it. :) |
@kernch Thanks very much for submitting this, it's much more reliable and uses a lot less resources! |
The use of the FSEvents API indeed solves the original issue. However, it seems the root folder of a (cloned) repo is not checked/monitored with the FSEvents API. Which leads to the same issue for files placed in the root folder. For example: I would fix this myself, but I can't get SparkleShare to build on Mountain Lion: also the instructions for creating a mac bundle are not compatible with the latest version of MonoDevelop ("Create Mac Installer" does not exist anymore, you have to go through Project > SparkleShare options) It would be great if anyone could give me a pointer on how to fix the build issue. |
@bomma have you installed the SDK too? |
I just ran into this issue today... I'm using a TiddlyWiki (http://tiddlywiki.com/) as wiki.html on my Mac. With the file in the root of a SparkleShare folder:
I moved the wiki.html to a subdirectory:
So, this still exists as a bug affecting innocent Mac users testing that SS works as advertised on files they stick in the root folder and edit... which it doesn't. :( |
BUT... Thank you all so much for at least documenting the problem here so I found the workaround (don't rely on SS to do anything with files in the top folder). |
I think it really depends on how certain apps save their files whether a file system event gets send that can be picked up. Why it doesn't work in a subfolder I don't know... |
Just to be clear, it does work in a sub folder. |
Sorry, that's what i meant. |
@hbons yes, sdk is installed isn't it enough to turn off this check (SparkleController.cs line 87): // Ignore changes in the root of each subfolder, these Can't test it though, since I can't build :( |
@bomma did you try this:
|
@hbons Yes, I followed the steps on the wiki. I used to be able to build. But then I did a clean install of OS X, Xcode, Mono and MonoDevelop. That's when it stopped working.
I installed automake etc using homebrew:
|
@bomma strange. it's also weird that it shows a syntax error... Maybe reclone the repo? And reinstall the make tools perhaps? |
After editing and saving a file using TextMate (http://macromates.com) SparkleShare does not sync that file.
Editing and saving the same file with TextEdit or VIM does cause SparkleShare to sync.
Maybe other programs besides TextMate are affected as well?
I consider this a serious defect since file changes might remain unnoticed.
I'm using SparkleShare 0.4.2 on OSX Lion 10.7.2 and TextMate Version 1.5.9 (1510).
Kind regards and thanks for all the great work!
Kevin.
The text was updated successfully, but these errors were encountered: