Author Topic: Auto Reload does not work in certain environment  (Read 1737 times)

Offline Andreas

  • Registered User
  • Jr. Member
  • *
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Auto Reload does not work in certain environment
« on: September 05, 2014, 08:24:30 am »
Auto Reload does not work in a certain environment. If you have a file opened in HippoEdit and the file is changed outside of HippoEdit, HippoEdit will not automatically detect the change and will not reload the file.

I've tried hard to create step-by-step instructions how you could reproduce the problem under Windows, but unfortunately in vain. Under Windows, Auto Reload works fine and the problem does not occur. However, the problem is 100% reproducible in my working environment, which involves Linux. Here are the details:

The file is located on a Linux Server which is mounted via NFS to a Windows PC. HippoEdit runs on that Windows PC and has opened the file. On the Linux Server, the file is updated by means of the command rsync.

I've tested with EmEditor and SynWrite whether they have the same problem as HippoEdit. They have not. EmEditor and SynWrite reliably detect the change of the file and automatically reload it.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Auto Reload does not work in certain environment
« Reply #1 on: September 05, 2014, 03:32:54 pm »
Hi Andreas,

it is known limitation :)

HippoEDIT uses file system notifications, available on Windows machines (only for local files) to reload files on change, while EmEditor and SynWrite probably use pulling of the last modified date by timer, to check if something has been changed. I think, in HE tracking of any remote file will not work. But, as far as remember, editor checks the modified date of target file before save, and you will not overwrite changes of someone working in parallel (or at least will be informed).

I will check such alternative puling logic for remote files (although I do not like it)  and will see if this can come in one of next builds. In any case it will be in my todos.

BR, Alex.

Offline Andreas

  • Registered User
  • Jr. Member
  • *
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: Auto Reload does not work in certain environment
« Reply #2 on: September 05, 2014, 03:58:15 pm »
But, as far as remember, editor checks the modified date of target file before save, and you will not overwrite changes of someone working in parallel (or at least will be informed).

Yes, that's true. It's better than nothing. But it means that the user is informed only at a late point in time. From a user perspective, Auto Reload would be preferable.


I will check such alternative puling logic for remote files (although I do not like it)  and will see if this can come in one of next builds. In any case it will be in my todos.

Thank you.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Auto Reload does not work in certain environment
« Reply #3 on: September 18, 2014, 12:27:05 am »
Hi Andreas,

I think, I need to clarify with you this certain environment when it not works... While I have done several experiments with remote drives (Windows and Linux) and seems that by me it is Ok.

Questions:
  • You have tried Auto-Reload on non modified file?
  • Have you tried Auto-Reload feature from menu File -> Auto Reload or just was expecting this automatically for non-modified file (this is how it shall be) ?
  • Have you expected update of non-focused window of the editor or even when it was focused you did not get an notification that file was changed? (I have opened remote file in HE, switched to notepad and change it, and saved. The NON modified file in HE has been reloaded automatically without any chnage in File menu. If file is modified I get notification only after switching to HE that file was modified - asking me to reload. So, as expected)

I am afraid I am not able to reproduce.

BR, Alex.

Offline Andreas

  • Registered User
  • Jr. Member
  • *
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: Auto Reload does not work in certain environment
« Reply #4 on: September 18, 2014, 08:18:46 am »
Hi Alex,

1. You have tried Auto-Reload on non modified file?

Yes, I did, and it didn't work. (Only after I modified the file in HippoEdit and tried to save it, HippoEdit realized that the file was modified outside HippoEdit.)

2. Have you tried Auto-Reload feature from menu File -> Auto Reload or just was expecting this automatically for non-modified file (this is how it shall be) ?

I have tried both, and none of them worked. By the way, I don't understand the purpose of the item Auto-Reload from menu the File menu. When I use it, nothing happens. Should there be a check mark besides the menu item? And shouldn't the feature always be enabled anyway?

3. Have you expected update of non-focused window of the editor or even when it was focused you did not get an notification that file was changed?

I have tried both, and none of them worked, i.e. I got no notification that the file was changed, and the file wasn't automatically reloaded either.

I am afraid I am not able to reproduce.

For me, the problem is 100% reproducible. I would be willing to run a special debug version for you (e.g. containing a quick & dirty implementation of a check of the file modification time) and provide you the output, if that would help you.

Best regards,
Andreas

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2169
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Auto Reload does not work in certain environment
« Reply #5 on: September 18, 2014, 01:50:20 pm »
Hi Andreas,

if File->Auto Reload is checked (it is actually checkbox, if you have not noticed) then file is automatically reloaded even if it is modified. Otherwise you will be always asked to confirm reload, if document is modified.

In dialog requesting to select an action after external change is noticed, you can set to always do reload for document. And without setting in File menu you can not switch it back.

OK, back to problem:
- is this issue happens by you only with some specific remote drive/directory or with any remote/local?
- which OS you use? And how share is connected (directly or via mapped drive).

You see I do not want to switch to polling logic for all cases, while this will additional time/tracing activities on HE side, which I would like to avoid, if OS already does it for me. So, I would prefer to limit pulling only for some limited uses cases, if possible to detect. Or have the pulling behaviour optional, with new XML flag.

Actually I do not think that test build will help (for pulling, if file lastModified time stamp changes, it shall work everywhere, except of 95/98 where I think there is 2 sec min difference).
For push variant currently I am using WIN API FindFirstChangeNotification, which looks to be working for remote shares also. But maybe not for all. Would be nice to know when it does not work...

BR, Alex

Offline Andreas

  • Registered User
  • Jr. Member
  • *
  • Posts: 53
  • Karma: +0/-0
    • View Profile
Re: Auto Reload does not work in certain environment
« Reply #6 on: September 18, 2014, 02:24:45 pm »
Hi Alex,

if File->Auto Reload is checked (it is actually checkbox, if you have not noticed) then file is automatically reloaded even if it is modified. Otherwise you will be always asked to confirm reload, if document is modified.

In dialog requesting to select an action after external change is noticed, you can set to always do reload for document. And without setting in File menu you can not switch it back.

Okay, thanks for the explanation. And you are right about the checkbox. I didn't realize that it was "checked".

is this issue happens by you only with some specific remote drive/directory or with any remote/local?

It only happens with one specific remote drive/directory, not with all.

Here is one more observation: The problem only happens when I log in to the Linux file server via ssh and change the file under Linux (e.g. with the vi editor). The problem does not occur when I modify the file with another editor running on the same Windows PC on which HippoEdit runs.

which OS you use?

Windows 7 Professional 64 Bit

And how share is connected (directly or via mapped drive).
Via mapped drive (mounted by means of Windows' 'net use' command)

Best regards,
Andreas

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1991 Views
Last post January 02, 2009, 12:21:26 pm
by alex
3 Replies
1723 Views
Last post March 23, 2009, 10:59:15 am
by alex
3 Replies
2139 Views
Last post April 22, 2009, 05:55:32 pm
by Arthur
1 Replies
1033 Views
Last post July 16, 2009, 10:35:15 am
by alex
1 Replies
1371 Views
Last post November 24, 2010, 12:55:31 am
by alex