question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Unsaved changes on double click

See original GitHub issue

Steps to reproduce the bug

  1. Open a .plist file
  2. Double click on any text field but DO NOT change the content
  3. ProperTree reports unsaved changes

Expected behaviour

ProperTree shouldn’t report unsaved changes if there’s no change (everyone would agree on that 😄)

Any possible fix?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:25 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
corpnewtcommented, Dec 10, 2022

I just checked but still presents the same issue. Actually it seems that only with DATA type fields it creates the problem. Just for the sake of ease, I compared the SHA-1 hashes BEFORE and AFTER the - Edited in the ProperTree window title, but the hashes are still the same. At this point wouldn’t it be easier to display - Edited only if the hash of the file changes?

Just as a side note on this - it’s possible, but would require serializing the plist, then gathering a checksum every time something may or may not be changed - which could end up being very slow on larger plists, slower hardware, or with users that make quick edits (or even just enter then esc a ton). I’m hoping to be able to just catch any changes the user might make, apply some simple-ish checks to see if we actually changed anything - then apply the - Edited as needed.

YES IT WORKS!!! Sadly I can only test on macOS. Have you checked that the issue seems fixed also in Win and Linux?

Perfect! As for Windows and Linux - I’ve not even been able to reproduce the double-click/drag-oriented issue locally, so I’ve just been going off your debugging, and I don’t personally use Linux so that will have to be checked by other users I suppose.

The changes are pushed though - and I’ll leave this issue open for awhile in case anyone else runs into it - but if it goes a couple weeks without additions, I’ll consider it closed.

Thanks for testing, glad we got it ironed out. Let me know if you run into other oddities!

-CorpNewt

1reaction
corpnewtcommented, Dec 10, 2022

That making the code work doesn’t really make sense though - as it’s immediately evaluated in the next line if the function didn’t return:

        # We moved it - make sure it shows as edited
        if not self.edited:
            self.edited = True
            self.title(self.title()+" - Edited")

And if we turn off the self.edited, but the file had already been edited, the title would become - Edited - Edited - which just adds another bug. I’ll see if I can reorder when the drag locks are applied to avoid any sort of race conditions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accidentally Clicked "Don't Save" in Microsoft WordIntegris
If you see the file's name in this pane, double click on it, then select File>Save to save the document as a .docx...
Read more >
Double click on a line in "find results" does not go to ... - GitHub
With the Find results window, the function of double click does not work for an unsaved new document. Steps to Reproduce the Issue....
Read more >
How to recover unsaved Word documents - Microsoft Learn
Restarting Word to open AutoRecover files​​ If this occurs, double-click the file name in the Document Recovery pane, select File > Save as,...
Read more >
Warn user before leaving web page with unsaved changes
Short, wrong answer: You can do this by handling the beforeunload event and returning a non-null string: window.addEventListener("beforeunload", function ...
Read more >
Bug #1481808 “MARC editor unsaved changes dialog does not fire ...
Bug Description · 1. Copy text to your clipboard. · 2. Navigate to the MARC editor interface. · 3. Paste the copied text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found