Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Saving is broken on OS X #174

Closed
jaanli opened this issue Apr 5, 2017 · 19 comments
Closed

Saving is broken on OS X #174

jaanli opened this issue Apr 5, 2017 · 19 comments

Comments

@jaanli
Copy link

jaanli commented Apr 5, 2017

Each time I save (File -> Save), a popup appears saying "The file '*.md' has changed, would you like to reload it?"

I'm not sure how to fix this - any ideas?

Thank you :)

@brrd
Copy link
Owner

brrd commented Apr 6, 2017

I guess we'll need more information about this.

Is the document saved anyway?
Is this happening when you are trying to save a new document or an existing one (or both)?
Is the file name in the popup still '*.md' when you are trying to save an existing document?
Is the "Save As..." menu working?
When using "Save As...", does the file selection dialog appear before you get the unexpected popup?
What happen when you click "Yes" (e.g. you try to reload the document)?
Is there any error message in the devtools console (hit F12 to open it)?

Finally, is someone else able to reproduce this bug on OSX? (I have no mac to try it where I am right now)

@jaanli
Copy link
Author

jaanli commented Apr 7, 2017

Is the document saved anyway?

Yes

Is this happening when you are trying to save a new document or an existing one (or both)?

Both

Is the file name in the popup still '*.md' when you are trying to save an existing document?

Yes

Is the "Save As..." menu working?

When using "Save As...", does the file selection dialog appear before you get the unexpected popup?

Yes & yes

What happen when you click "Yes" (e.g. you try to reload the document)?

It reloads the document and the cursor goes back to the top of the document.

Is there any error message in the devtools console (hit F12 to open it)?

No

Hope this helps!

@nloveladyallen
Copy link
Contributor

Are you running the binary from Releases or from source?

@jaanli
Copy link
Author

jaanli commented Apr 7, 2017

@brrd
Copy link
Owner

brrd commented Apr 10, 2017

@altosaar Thanks for those additional informations. This still sounds like a total mystery to me. I can't figure out what happens... 😕 I'll check the source again when I get time.

@eaglesky
Copy link

I met exactly same issue on my Mac(Version 10.10.5), same program. Is there a workaround for this?

@brrd
Copy link
Owner

brrd commented Apr 16, 2017

@eaglesky I'm sorry but the only workaround that I see now is to use the previous version of Abricotine (0.4.0). I really want to fix this as soon as possible but this is difficult because I can't reproduce this issue...

@brrd brrd added OSX and removed need info labels Apr 16, 2017
@Netherdrake
Copy link

Netherdrake commented May 4, 2017

Abricotine works flawlessly on Linux, however I can I can confirm this issue on OSX.

Any tips on how to get more information that would help you with debugging?

@brrd
Copy link
Owner

brrd commented May 4, 2017

Any tips on how to get more information that would help you with debugging?

Unfortunately not. I would like to create a special version with some additional logging but I'm really busy now and I can't find the time to do it.

Is this issue happening to every OSX user in 0.5.0?

@Mottotime
Copy link

Yes. I have the same problem, too.

@brrd
Copy link
Owner

brrd commented Jun 7, 2017

This is obviously a regression introduced with #121.
On OSX, handleAsyncFileChange() is sometimes called after the app saved the document, meaning abrDoc.pauseWatcher() is not working properly or in the right time. But I don't really understand what happens exactly...
As I could see, this issue occurs less often when the app is directly run from source.
I'm still looking for a way to fix this...

@Netherdrake
Copy link

Any updates on the issue?

@brrd
Copy link
Owner

brrd commented Jul 20, 2017

@Netherdrake I began to work on it but this is a huge work and I have no time right now. I'll let you know here if I get some improvement.

@Netherdrake
Copy link

No problem. I still love the app, and use it almost every day.

brrd added a commit that referenced this issue Oct 1, 2017
@brrd
Copy link
Owner

brrd commented Oct 1, 2017

I spent hours looking for a solution and I finally came to the very simple conclusion that chokidar is very slow when used on OSX from an Electron process 😕. The easiest solution I found is to wait a bit (1000 ms) before restarting the watcher once the doc is saved.

Can you build Abricotine from this branch where I commited the fix in order to confirm you don't encounter this issue anymore?

@BernsteinA
Copy link

The issue appears to be fixed for me on the fix-watcher branch, built on osx 10.12.6

@Netherdrake
Copy link

Good job @brrd. Looking forward to the new release :)

@BernsteinA
Copy link

BernsteinA commented Oct 2, 2017

Update: Still happens if I save twice in quick succession. Maybe this would solve it?

if(this.delayedWatcher) window.clearTimeout(this.delayedWatcher);
        this.delayedWatcher = window.setTimeout(function () {

@brrd
Copy link
Owner

brrd commented Oct 2, 2017

@BernsteinA You're right, thanks. This should work better now.

@brrd brrd closed this as completed Oct 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants