-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Allow 0.5 seconds difference in file timestamps before warning of conflicting change #2698
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
Conversation
…flicting changes See jupytergh-484
// We want to check last_modified (disk) > that.last_modified (our last save) | ||
// In some cases the filesystem reports an inconsistent time, | ||
// so we allow 0.5 seconds difference before complaining. | ||
if ((last_modified.getTime() - that.last_modified.getTime()) > 500) { // 500 ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Math.abs()
to allow it to go in either direction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, reading the original code, I take that back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need it to go in either direction - we want to show the message if the on-disk timestamp is newer than the timestamp from when we last saved it. The other way round would be weird.
Hi, I tried to install in editable mode. It seems that even after I have left the tab for a while, if I press Ctrl+s to save the notebook, it still throws the warning of whether I want to overwrite change outside this tab. jupyter-notebook --version tells me it is 5.1.0.dev, so I suppose it is the newest one? This is my conda environment: |
Can you try adding this in to the Javascript just before the check, and see in the browser's console how different the two timestamps are: console.log(last_modified);
console.log(that.last_modified); |
Sorry, it was my mistake. I installed master branch instead of from your repo. So I just incorporated the change to my master branch copy and no waning is thrown now in the tab.
|
Thanks, that sounds like it's working correctly. The errors you see are something separate, though probably also a consequence of the shared filesystem. They're already being caught and logged, so it should be OK. |
Excellent @takluyver!! |
I still get this error occasionally (in Jupyter 5.4.0) when opening a notebook I've downloaded from Github or Kaggle. Here's a quick fix if you need relief and don't have time to go on a safari hunt for a solution: It doesn't fix the problem and you still will get a dozen error messages every time you save the notebook, but at least you can work without error dialogs popping up every 4 or 5 seconds. |
Something closely-related is still a challenge in 5.7.0: ipython/ipython#8456 |
See gh-484