Mark modified tabs doesn't work correcly on IC 2.0

Issue #1104 resolved
Nunzio Capasso created an issue

Hello Scott, i am sorry to be always me to bother you :P but i found this bug and i just wanted u to know.

In the specific i am talking about this IntelliJ function:

Settings-->Editor-->General-->Editor Tabs-->[Flag] Mark modified(*)

This function simply adds a * on tab that's being edited and and just disappears when u save it , thing that doesn't happen at the moment, infact when u save a modified file the * doesn't go away.

This issue appears to be only in IC 2.0 (i personally tested it) and in both version of IJ (communty\ultimate latest releases) .Just to make sure that this is IC related i tried to edit and save a file that's outside my project and it worked.

I obtained the log with this filters:

#com.illuminatedcloud.intellij.builder.IlluminatedCloudSaveAllAction
#com.illuminatedcloud.intellij.builder.ForceComBuilder
#com.illuminatedcloud.intellij.builder.ForceComBuilderUtil
#com.illuminatedcloud.intellij.builder.ForceComMetadataApiDeployer
#com.illuminatedcloud.intellij.builder.ForceComSfdxDeployer
#com.illuminatedcloud.intellij.builder.ForceComToolingApiDeployer
#com.illuminatedcloud.intellij.builder.ForceComBuildFailureAnnotator
#com.illuminatedcloud.util.VariableLengthPollingInterval

I also leave u a visual representation of the problem.

Thanks, Nunzio.

Comments (47)

  1. Scott Wells repo owner

    Hey, Nunzio. It's not a bother at all! Yes, this has been reported by a few other users and is a bug with the recent tabbed editors enhancements. I'll be releasing a new build this morning with the fix. Keep an eye out for the next build and let me know if it doesn't resolve the issue for you after updating.

  2. Scott Wells repo owner

    My pleasure! I just hate that some of the things I do (hopefully temporarily!) inconvenience you. The new build is posted. Let me know if you continue to see this issue after updating to 2.0.3.6.

  3. Scott Wells repo owner
    • changed status to open

    Well that's a bummer. I know this seems like a silly thing to ask, but can you describe the exact steps you're following to reproduce this behavior? I was only able to reproduce it one way which is the one that I addressed in this build. There's obviously some lingering aspect of it that doesn't occur given my particular workflow.

  4. Scott Wells repo owner

    Okay. Do you mind sharing a screenshot of your Illuminated Cloud > Configure Application > Validation and Deployment settings?

  5. Scott Wells repo owner

    Thanks. Can you check Override Save All action and Deploy on save and uncheck Deploy all modified files and see if the behavior still exists? I think the remaining issue is with the default IDE's save behavior and tabbed editors. That would definitely help to isolate it. Thanks!

  6. Nunzio Capasso reporter

    Just tested it with this settings and it seems to be working but unfortunately only on the first circle of editing and saving. Test scenario:

    Open a class -> edit -> save it ===> work

    same class -->edit --> save it ===> doesen't work

    (as always i tested it on multiple machines)

  7. Scott Wells repo owner

    Okay, thanks for the update. I'll dig in again and see if I can figure out what's going on. Sorry for the false start!

  8. Scott Wells repo owner

    Guys, I seriously can't reproduce this. I trust that it's happening as I'm hearing about it from enough folks, but I'm perplexed as to what the difference would be between how things are working for those of you who are having this issue and how they're working for me. Here's my experience:

    Issue1104.gif

    I have the same experience regardless of how I have things configured in the Validation and Deployment settings. The image above was configured like the screenshot above, but I've also tried it with Override Save All action enabled, Deploy all modified files disabled, and Deploy on save enabled, and the behavior is identical.

    Just to make sure we're all on a level playing field, I'm using IntelliJ IDEA 2018.2.3. Are any of you using an earlier version of the base IDE? If so, would you mind updating to the most recent to see if that changes the behavior? Please let me know. Thanks!

  9. Eric Kintzer

    Sticky file tab modified (*) observed as follows:

    I'm on

    IntelliJ IDEA 2018.2.3 (Community Edition)
    Build #IC-182.4323.46, built on September 3, 2018
    JRE: 1.8.0_152-release-1248-b8 x86_64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    macOS 10.13.6
    

    with Validation and Deployment like this:

    IC tab modified sticky.png

  10. Scott Wells repo owner

    And I apologize for the repetition, but are there any stack traces or other types of errors in your idea.log around the times that you reproduce this behavior? Mine is clean, so if there are any errors in your logs that would definitely be useful information.

  11. Nunzio Capasso reporter

    Hi Scoot, I really don't know at this point what can be the difference between your and our setup. I also created a whole new project but the problem persist. Should i obtain my log with a different debug level?

    In my office we all using the latests version of IntelliJ:

    IntelliJ IDEA 2018.2.3 (Ultimate Edition) || (or community) Build #IU-182.4323.46, built on September 3, 2018 JRE: 1.8.0_152-release-1248-b8 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0

  12. Scott Wells repo owner

    Thanks for confirming. Yeah, I'm quite perplexed at the difference in behavior, but I do have an idea on something to try. I'll see if I can put something together over the weekend that will hopefully address this once and for all.

  13. Scott Wells repo owner

    Can you guys see if this test build improves the situation at all? Just download the archive and then install it using Settings/Preferences>Plugins>Install plugin from disk. After the required IDE restart, please let me know if you see any difference in behavior. Thanks!

  14. Nunzio Capasso reporter

    Hello Scoot , i am sorry to be a bit late on this. I just tried but unfortunately i cant get into intelliJ when using this version of IC. (obviously we have a license) http://bit.ly/2CEn1Fd

  15. Nunzio Capasso reporter

    Hello Scoot, i managed to install it ( but i had to use an alternative way) http://bit.ly/2CIyALM Anyway the problem persist :( . I also tried it on different pcs. Would u like to personally check on my pc? we just need Teamviewer installed. I also noticed this strange behaviour when adding\ removing the nav bar that may be useful for you: http://bit.ly/2CQ2vl0

  16. Scott Wells repo owner

    Thanks, Nunzio. Can you describe how you installed it? I didn't bump the version number in this test build so I want to be 100% sure that you're using it. Thanks much for continuing to help provide support debugging this!

  17. Nunzio Capasso reporter

    I just replaced the entire lib folder inside plugin\IC 2 . Yes u didn't changed the version but the build-number is different :).

  18. Scott Wells repo owner

    Okay. So I'm really stymied by this one. I've updated IC to sync the editor/file system notions of modified on every deployment path immediately after it saves editor contents to the file system. It's happening on both Windows (Nunzio) and Mac (Eric), so it's not an OS-specific thing. We're all on the latest builds of the underlying IDE, so that's not it. I'm going to need to think about how best to proceed for further debugging as we've tried pretty much every obvious (and several not-so-obvious) paths already.

    Nunzio, I may well take you up on a screenshare, though from the videos you've posted, I can see it happening...I just can't seem to reproduce it. Still, there may be some nuance involved that's not obvious from the discrete videos. Let me try a few things today and then, if you're available, perhaps we'll do a screenshare tomorrow.

  19. Nunzio Capasso reporter

    OK thx Scoot, I just would like to share with you what i just discovered. http://bit.ly/2CKBtM4 So basicly it works on new classes but not on old ones (even if u delete them and re-retrive)

  20. Scott Wells repo owner

    So there's one other material difference between those two beside new vs. old. In one you're keeping the code valid by editing a comment and in the other you're making the code invalid by adding free-form text above the class declaration outside the comment. Do you get the same behavior if you make these changes consistently? In other words, if you add comment text to both old and new, do they both seem to work? If you add free-form text outside of a comment to both old and new, do they both fail to remove the modified marker?

  21. Nunzio Capasso reporter

    nope , now all classes have the same behaviour again and i am not able to replicate the case that i just showed you . I really cant find any logic in this :P i am sorry.

  22. Scott Wells repo owner

    Yeah, that's what I feared. Okay, let me see if I can instrument some additional logging tonight that will look for situations where the two modified states are out of sync and log them...perhaps even try to fix them. That won't be the ultimate fix, but I'm just trying to corner this behavior since it obviously occurs for some subset of people, but I'll be darned if I can reproduce it across four different machines now (Windows x 2, Linux, and Mac).

  23. nivgo

    Hi Scott, I got the same issue after updating IC 2.0 to the latest version: 2.0.3.6 I was sure this is the Intellij version issue or something, hence I updated to the latest Intellij as well (2018.2.3) and still got the issue.

    I have tried playing with IC settings regarding saving files but nothing helped. In addition as you know a lot of the people in my office are using IC so I have been doing some random testing with different computers and different OS (Mac/Windows), for all of them when upgrading to 2.0.3.6 the issue appear - note that the first time you save it's working, afterwards it does not works anymore.

    • This issue appear in all file types not only classes.
  24. Scott Wells repo owner

    Okay, this is a preview of the build I'm planning to release tomorrow. I've tried once again to coerce the editor/filesystem modified states into sync in conjunction with save/deploy operations. I have changed the timing a bit, though, as many things happen async.

    If you're experiencing this issue consistently, please install this build using Settings/Preferences>Plugins>Install plugin from disk, then enable debug logging for metadata deployment as documented here:

    http://www.illuminatedcloud.com/support/debuglogging

    then try to reproduce the issue. Please allow the deployment to complete and report status as I've added some diagnostic logging at the end of deployment around this as well.

    Whether this does or does not resolve the issue, please attach your idea.log from your attempt to reproduce it here or, if you'd prefer, you can email it to support@illuminatedcloud.com. If the problem has reproduced, please also tell me the names of the file(s) for which the modified indicator is not being cleared properly so that I can correlate that to the logged information.

    Thanks much!

  25. Scott Wells repo owner

    Thanks, Nunzio. That definitely helps, though unfortunately it doesn't yield the answer. It does, however, tell me that whatever is going on isn't (directly) related to the solution I'm currently providing. Here's the relevant excerpt from the logs:

    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil - Checking for stale modified state for C:/Users/capasso/IdeaProjects/path/to/classes/Redacted.cls.
    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil -   fileModified = false; editorModified = false 
    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil - Checking for stale modified state for C:/Users/capasso/IdeaProjects/path/to/classes/Redacted.cls-meta.xml.
    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil -   fileModified = false; editorModified = false 
    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil - Checking for stale modified state for C:/Users/capasso/IdeaProjects/path/to/aura/Redacted/Redacted.cmp. 
    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil -   fileModified = false; editorModified = false 
    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil - Checking for stale modified state for C:/Users/capasso/IdeaProjects/path/to/aura/Redacted/RedactedController.js. 
    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil -   fileModified = false; editorModified = false 
    2018-09-17 10:02:55,360 [ 178855]  DEBUG - ij.builder.ForceComBuilderUtil - Checking for stale modified state for C:/Users/capasso/IdeaProjects/path/to/aura/Redacted/RedactedHelper.js. 
    2018-09-17 10:02:55,361 [ 178856]  DEBUG - ij.builder.ForceComBuilderUtil -   fileModified = false; editorModified = false 
    2018-09-17 10:02:55,361 [ 178856]  DEBUG - ij.builder.ForceComBuilderUtil - Checking for stale modified state for C:/Users/capasso/IdeaProjects/path/to/aura/Redacted/Redacted.cmp-meta.xml. 
    2018-09-17 10:02:55,361 [ 178856]  DEBUG - ij.builder.ForceComBuilderUtil -   fileModified = false; editorModified = false 
    2018-09-17 10:02:55,361 [ 178856]  DEBUG - ij.builder.ForceComBuilderUtil - Checking for stale modified state for C:/Users/capasso/Documents/MigrationToolkit/sample/Deploy/package-TMP.xml. 
    2018-09-17 10:02:55,361 [ 178856]  DEBUG - ij.builder.ForceComBuilderUtil -   fileModified = false; editorModified = false 
    2018-09-17 10:02:55,361 [ 178856]  DEBUG - ij.builder.ForceComBuilderUtil - Checking for stale modified state for C:/Users/capasso/Documents/MigrationToolkit/sample/build.properties. 
    2018-09-17 10:02:55,361 [ 178856]  DEBUG - ij.builder.ForceComBuilderUtil -   fileModified = false; editorModified = false 
    

    That is enumerating all open editors including all tabs of tabbed editors and determining the filesystem and editor modified states. If those were found to be different--in particular if the editor were marked as modified but the filesystem was not--it would force the editor to update itself, then it would tell the editor tabs to refresh their presentation which removes the stale stars.

    We can try one more thing...I can have it always do that last step of forcing the editors to refresh themselves. I'll post a new build here shortly with that minor change. If that doesn't do it--and at this point I don't have any sense of confidence that it will--then I'll need to follow up with JetBrains to understand how to proceed on debugging this.

    We'll get to the bottom of it, but at this point it's nothing obvious. I'm bummed but not entirely surprised to see those statuses in sync, though that just gets further from explaining what's causing this.

  26. nivgo

    Hi Scott, if I'm closing the tab file and reopen it, it's removes the star (as it should) - so I think refreshing tabs might fix it. Thanks.

  27. Scott Wells repo owner

    Okay, let's try this build which refreshes the tab status unconditionally. Please let me know if it helps or not. No need for additional logs as the logging hasn't changed, just whether it performs the refresh. Oh, and if it does fix the issue, please let me know if the star is cleared before (or very early in) deployment or not until deployment completes.

  28. Nunzio Capasso reporter

    i am very happy to say that it works! And the star get cleared right when the deployment attempt starts. http://bit.ly/2MGFiBD However if u disable those voices "Override Save All action" and "Deploy on save" , obviously the deploy doesn't start and the star doesn't get cleared. The reason i am doing this is because i often save files only locally and i also like the ability of "choosing" when to deploy(by using the Force save hotkey). is this something that make sense?is this something achievable?

    Thanks for the awesome work Scott :)

  29. Scott Wells repo owner

    Okay, that's great news! I'll include this version of the fix in today's new build.

    As for it still occurring when Override Save All action is disabled, I can see if I can get into the event stream there and do a similar type of reconciling/refreshing. I'll try to do something in this build if it's obvious.

    Thanks so much for all of the feedback and assistance working through this!

  30. Scott Wells repo owner

    Okay, let's try one more build that attempts to address the issue when the save all action is not enabled. Nunzio, can you let me know if things behave properly in that case for you (as always, I'm unable to reproduce the issue so it's impossible for me to verify)? What I've done is made it reconcile the modified states when IC receives any type of file save event for a file under its direct management.

  31. Scott Wells repo owner

    Delivered in 2.0.3.7. Hopefully it will also address the scenario where Override Save All action is disabled as well, but the primary scenario seems to be addressed.

  32. Scott Wells repo owner

    For those of you who installed the most recent test builds, the official build has the same version but a slightly different implementation of the fix, in particular the last part that Nunzio requested. To get onto the official build you can uninstall/reinstall from the plugin repo or you can download the latest build attached here and install it as it's the same.

  33. nivgo

    Hi Scott, I have just notice I have an issue with the fix. If I am using the following settings (which I am): Override Save All action - checked. Deploy all modified files - unchecked.

    Which mean when saving my current file I expect the star to disappear only from it and it alone, but the star is removed from all modified files, while only my current file is been deployed (as expected), which obviously make a confusing to which files are needed to be deployed in the end.

    Thanks and sorry for asking to reopen this :)

  34. Log in to comment